use of org.springframework.security.oauth2.provider.endpoint.DefaultRedirectResolver in project powerauth-webflow by wultra.
the class OAuth2AuthorizationServerConfiguration method configureAuthorizationEndpoint.
/**
* Configures authorization endpoint.
* @param authorizationEndpoint Authorization endpoint.
*/
@Autowired
public void configureAuthorizationEndpoint(AuthorizationEndpoint authorizationEndpoint) {
// WORKAROUND: Cancel the session just before the redirect
DefaultRedirectResolver redirectResolver = new DefaultRedirectResolver() {
@Override
public String resolveRedirect(String requestedRedirect, ClientDetails client) throws OAuth2Exception {
SecurityContextHolder.clearContext();
return super.resolveRedirect(requestedRedirect, client);
}
};
redirectResolver.setMatchPorts(false);
authorizationEndpoint.setRedirectResolver(redirectResolver);
}
use of org.springframework.security.oauth2.provider.endpoint.DefaultRedirectResolver in project spring-security-oauth by spring-projects.
the class DefaultRedirectResolverTests method setup.
@Before
public void setup() {
client = new BaseClientDetails();
client.setAuthorizedGrantTypes(Collections.singleton("authorization_code"));
resolver = new DefaultRedirectResolver();
}
use of org.springframework.security.oauth2.provider.endpoint.DefaultRedirectResolver in project spring-security-oauth by spring-projects.
the class AuthorizationEndpointTests method init.
@Before
public void init() throws Exception {
client = new BaseClientDetails();
client.setRegisteredRedirectUri(Collections.singleton("https://anywhere.com"));
client.setAuthorizedGrantTypes(Arrays.asList("authorization_code", "implicit"));
endpoint.setClientDetailsService(new ClientDetailsService() {
public ClientDetails loadClientByClientId(String clientId) throws OAuth2Exception {
return client;
}
});
endpoint.setTokenGranter(new TokenGranter() {
public OAuth2AccessToken grant(String grantType, TokenRequest tokenRequest) {
return null;
}
});
endpoint.setRedirectResolver(new DefaultRedirectResolver());
endpoint.afterPropertiesSet();
}
Aggregations