Search in sources :

Example 1 with ImplicitResourceDetails

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());
    }
}
Also used : AbstractRedirectResourceDetails(org.springframework.security.oauth2.client.token.grant.redirect.AbstractRedirectResourceDetails) ResourceOwnerPasswordResourceDetails(org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails) ImplicitResourceDetails(org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails) BaseOAuth2ProtectedResourceDetails(org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails) BeforeOAuth2Context(org.springframework.security.oauth2.client.test.BeforeOAuth2Context)

Aggregations

BaseOAuth2ProtectedResourceDetails (org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails)1 BeforeOAuth2Context (org.springframework.security.oauth2.client.test.BeforeOAuth2Context)1 ImplicitResourceDetails (org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails)1 ResourceOwnerPasswordResourceDetails (org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails)1 AbstractRedirectResourceDetails (org.springframework.security.oauth2.client.token.grant.redirect.AbstractRedirectResourceDetails)1