use of org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails in project spring-security-oauth by spring-projects.
the class AbstractIntegrationTests method fixPaths.
@BeforeOAuth2Context
public void fixPaths() {
String prefix = server.getServletPrefix();
http.setPort(port);
http.setPrefix(prefix);
BaseOAuth2ProtectedResourceDetails resource = (BaseOAuth2ProtectedResourceDetails) context.getResource();
resource.setAccessTokenUri(http.getUrl(tokenPath()));
if (resource instanceof AbstractRedirectResourceDetails) {
((AbstractRedirectResourceDetails) resource).setUserAuthorizationUri(http.getUrl(authorizePath()));
}
if (resource instanceof ImplicitResourceDetails) {
resource.setAccessTokenUri(http.getUrl(authorizePath()));
}
if (resource instanceof ResourceOwnerPasswordResourceDetails) {
((ResourceOwnerPasswordResourceDetails) resource).setUsername(security.getUser().getName());
((ResourceOwnerPasswordResourceDetails) resource).setPassword(security.getUser().getPassword());
}
}
Aggregations