Package org.surfnet.oaaas.auth.principal

Examples of org.surfnet.oaaas.auth.principal.AuthenticatedPrincipal


            request.getSession().setAttribute(PostCasAuthenticationFilter.REDIRECT_URL, uri + "?" + queryString);
            response.sendRedirect("/cas");
            return;
        }
        else {
            AuthenticatedPrincipal principal = new AuthenticatedPrincipal(casUser.getUid());
            principal.setAdminPrincipal(casUser.isAdmin);
            super.setPrincipal(request, principal);
            super.setAuthStateValue(request, authStateValue);
            chain.doFilter(request, response);
        }
    }
View Full Code Here


   
    // Is this our bad user?
    if (BAD_USER.equals(username)) {
      return null;
    }
    return new AuthenticatedPrincipal(username);
  }
View Full Code Here

  @Override
  public void authenticate(HttpServletRequest request, HttpServletResponse response, FilterChain chain,
      String authStateValue, String returnUri) throws IOException, ServletException {
    super.setAuthStateValue(request, authStateValue);
    AuthenticatedPrincipal principal = getAuthenticatedPrincipal();
    super.setPrincipal(request, principal);
    chain.doFilter(request, response);
  }
View Full Code Here

    super.setPrincipal(request, principal);
    chain.doFilter(request, response);
  }

  protected AuthenticatedPrincipal getAuthenticatedPrincipal() {
    return new AuthenticatedPrincipal("noop");
  }
View Full Code Here

*/
public class NoopAdminAuthenticator extends NoopAuthenticator {

  @Override
  protected AuthenticatedPrincipal getAuthenticatedPrincipal() {
    AuthenticatedPrincipal principal = super.getAuthenticatedPrincipal();
    principal.setAdminPrincipal(true);
    return principal;
  }
View Full Code Here

  private AccessToken createAccessToken(AuthorizationRequest request, boolean isImplicitGrant) {
    Client client = request.getClient();
    long expireDuration = client.getExpireDuration();
    long expires = (expireDuration == 0L ? 0L : (System.currentTimeMillis() + (1000 * expireDuration)));
    String refreshToken = (client.isUseRefreshTokens() && !isImplicitGrant) ? getTokenValue(true) : null;
    AuthenticatedPrincipal principal = request.getPrincipal();
    AccessToken token = new AccessToken(getTokenValue(false), principal, client, expires, request.getGrantedScopes(), refreshToken);
    return accessTokenRepository.save(token);
  }
View Full Code Here

 
  private AuthorizationRequest clientCredentialToken(AccessTokenRequest accessTokenRequest) {
    AuthorizationRequest request =  new AuthorizationRequest();
    request.setClient(accessTokenRequest.getClient());
    // We have to construct a AuthenticatedPrincipal on-the-fly as there is only key-secret authentication
    request.setPrincipal(new AuthenticatedPrincipal(request.getClient().getClientId()));
    // Get scopes (either from request or the client's default set)
    request.setGrantedScopes(accessTokenRequest.getScopeList());
    return request;
  }
View Full Code Here

    return request;
  }
 
  private AuthorizationRequest passwordToken(AccessTokenRequest accessTokenRequest) {
    // Authenticate the resource owner
    AuthenticatedPrincipal principal =
        resourceOwnerAuthenticator.authenticate(accessTokenRequest.getUsername(),
            accessTokenRequest.getPassword());
    if (principal == null) {
      throw new ValidationResponseException(ValidationResponse.INVALID_GRANT_PASSWORD);
    }
View Full Code Here

TOP

Related Classes of org.surfnet.oaaas.auth.principal.AuthenticatedPrincipal

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.