Package org.springframework.security.oauth2.provider.approval

Examples of org.springframework.security.oauth2.provider.approval.DefaultUserApprovalHandler


        token.setAdditionalInformation(Collections.singletonMap("foo", (Object) "bar"));
        return token;

      }
    });
    endpoint.setUserApprovalHandler(new DefaultUserApprovalHandler() {
      public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest,
          Authentication userAuthentication) {
        return authorizationRequest;
      }
View Full Code Here


        DefaultOAuth2AccessToken token = new DefaultOAuth2AccessToken("FOO");
        token.setScope(Collections.singleton("read"));
        return token;
      }
    });
    endpoint.setUserApprovalHandler(new DefaultUserApprovalHandler() {
      public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest,
          Authentication userAuthentication) {
        return authorizationRequest;
      }
View Full Code Here

      public OAuth2AccessToken grant(String grantType, TokenRequest tokenRequest) {
        DefaultOAuth2AccessToken token = new DefaultOAuth2AccessToken("FOO");
        return token;
      }
    });
    endpoint.setUserApprovalHandler(new DefaultUserApprovalHandler() {
      public boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
        return true;
      }
    });
    AuthorizationRequest authorizationRequest = getAuthorizationRequest("foo", "http://anywhere.com?foo=bar",
View Full Code Here

        DefaultOAuth2AccessToken token = new DefaultOAuth2AccessToken("FOO");
        token.setScope(new LinkedHashSet<String>(Arrays.asList("read", "write")));
        return token;
      }
    });
    endpoint.setUserApprovalHandler(new DefaultUserApprovalHandler() {
      public boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
        return true;
      }

      public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest,
View Full Code Here

    endpoint.setTokenGranter(new TokenGranter() {
      public OAuth2AccessToken grant(String grantType, TokenRequest tokenRequest) {
        throw new IllegalStateException("Shouldn't be called");
      }
    });
    endpoint.setUserApprovalHandler(new DefaultUserApprovalHandler() {
      public boolean isApproved(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
        return true;
      }

      public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest,
View Full Code Here

    assertEquals("forward:/oauth/confirm_access", result.getViewName());
  }

  @Test
  public void testImplicitError() throws Exception {
    endpoint.setUserApprovalHandler(new DefaultUserApprovalHandler() {
      public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest,
          Authentication userAuthentication) {
        return authorizationRequest;
      }
View Full Code Here

    return newClient;
  }
 
  private OAuth2AccessTokenEntity fetchValidRegistrationToken(OAuth2Authentication auth, ClientDetailsEntity client) {
   
    OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) auth.getDetails();
    OAuth2AccessTokenEntity token = tokenService.readAccessToken(details.getTokenValue());
   
    if (config.getRegTokenLifeTime() != null) {
   
      try {
        // Re-issue the token if it has been issued before [currentTime - validity]
View Full Code Here

    return newClient;
  }
 
  private OAuth2AccessTokenEntity fetchValidRegistrationToken(OAuth2Authentication auth, ClientDetailsEntity client) {
   
    OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) auth.getDetails();
    OAuth2AccessTokenEntity token = tokenService.readAccessToken(details.getTokenValue());
   
    if (config.getRegTokenLifeTime() != null) {
   
      try {
        // Re-issue the token if it has been issued before [currentTime - validity]
View Full Code Here

    @EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true)
    private static class GlobalSecurityConfiguration extends GlobalMethodSecurityConfiguration {<% if (authenticationType == 'token') { %>

        @Override
        protected MethodSecurityExpressionHandler createExpressionHandler() {
            return new OAuth2MethodSecurityExpressionHandler();
        }<% } %>
View Full Code Here

  private OAuth2RequestFactory defaultOAuth2RequestFactory;

  public void afterPropertiesSet() throws Exception {
    Assert.state(tokenGranter != null, "TokenGranter must be provided");
    Assert.state(clientDetailsService != null, "ClientDetailsService must be provided");
    defaultOAuth2RequestFactory = new DefaultOAuth2RequestFactory(getClientDetailsService());
    if (oAuth2RequestFactory == null) {
      oAuth2RequestFactory = defaultOAuth2RequestFactory;
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.oauth2.provider.approval.DefaultUserApprovalHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.