Add GrantedAuthorities.FACTOR_*_AUTHORITY
Closes gh-17952
This commit is contained in:
+2
-1
@@ -58,6 +58,7 @@ import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.GrantedAuthorities;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
@@ -113,7 +114,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public final class OpenSaml5AuthenticationProvider implements AuthenticationProvider {
|
||||
|
||||
private static final String AUTHORITY = "FACTOR_SAML_RESPONSE";
|
||||
private static final String AUTHORITY = GrantedAuthorities.FACTOR_SAML_RESPONSE_AUTHORITY;
|
||||
|
||||
private final BaseOpenSamlAuthenticationProvider delegate;
|
||||
|
||||
|
||||
+2
-1
@@ -73,6 +73,7 @@ import org.opensaml.xmlsec.signature.support.SignatureConstants;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.security.authentication.SecurityAssertions;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthorities;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.jackson2.SecurityJackson2Modules;
|
||||
@@ -990,7 +991,7 @@ public class OpenSaml5AuthenticationProviderTests {
|
||||
Response response = TestOpenSamlObjects.signedResponseWithOneAssertion();
|
||||
Authentication request = token(response, verifying(registration()));
|
||||
Authentication result = this.provider.authenticate(request);
|
||||
SecurityAssertions.assertThat(result).hasAuthority("FACTOR_SAML_RESPONSE");
|
||||
SecurityAssertions.assertThat(result).hasAuthority(GrantedAuthorities.FACTOR_SAML_RESPONSE_AUTHORITY);
|
||||
}
|
||||
|
||||
private <T extends XMLObject> T build(QName qName) {
|
||||
|
||||
Reference in New Issue
Block a user