Package org.mitre.openid.connect.model

Examples of org.mitre.openid.connect.model.UserInfo


      model.addAttribute("code", HttpStatus.FORBIDDEN);
      return HttpCodeView.VIEWNAME;
    }

    String username = auth.getName();
    UserInfo userInfo = userInfoService.getByUsernameAndClientId(username, auth.getOAuth2Request().getClientId());

    if (userInfo == null) {
      logger.error("getInfo failed; user not found: " + username);
      model.addAttribute("code", HttpStatus.NOT_FOUND);
      return HttpCodeView.VIEWNAME;
View Full Code Here


        OAuth2AccessTokenEntity accessToken = null;
        OAuth2RefreshTokenEntity refreshToken = null;
    ClientDetailsEntity tokenClient;
    Set<String> scopes;
    UserInfo user;

    try {

      // check access tokens first (includes ID tokens)
      accessToken = tokenServices.readAccessToken(tokenValue);
View Full Code Here

    sortedScopes.addAll(Sets.difference(scopes, systemScopes));

    model.put("scopes", sortedScopes);

    // get the userinfo claims for each scope
    UserInfo user = userInfoService.getByUsername(p.getName());
    Map<String, Map<String, String>> claimsForScopes = new HashMap<String, Map<String, String>>();
    if (user != null) {
      JsonObject userJson = user.toJson();
 
      for (SystemScope systemScope : sortedScopes) {
        Map<String, String> claimValues = new HashMap<String, String>();
 
        Set<String> claims = scopeClaimTranslationService.getClaimsForScope(systemScope.getValue());
View Full Code Here

  @Override
  @Transactional
  public void remove(UserInfo userInfo) {
    DefaultUserInfo dui = (DefaultUserInfo)userInfo;
    UserInfo found = manager.find(DefaultUserInfo.class, dui.getId());

    if (found != null) {
      manager.remove(userInfo);
    } else {
      throw new IllegalArgumentException();
View Full Code Here

  @Override
  public UserInfo getByUsernameAndClientId(String username, String clientId) {

    ClientDetailsEntity client = clientService.loadClientByClientId(clientId);

    UserInfo userInfo = getByUsername(username);

    if (client == null || userInfo == null) {
      return null;
    }

    if (SubjectType.PAIRWISE.equals(client.getSubjectType())) {
      String pairwiseSub = pairwiseIdentifierService.getIdentifier(userInfo, client);
      userInfo.setSub(pairwiseSub);
    }

    return userInfo;

  }
View Full Code Here

        // given
        OAuth2AccessTokenEntity accessToken = accessToken(new Date(123), scopes("foo", "bar"), "Bearer",
                authentication("name", request("clientId")));

        UserInfo userInfo = userInfo("sub");

        // when
        Map<String, Object> result = assembler.assembleFrom(accessToken, userInfo);

View Full Code Here

        // given
        OAuth2AccessTokenEntity accessToken = accessToken(null, scopes("foo", "bar"), "Bearer",
                authentication("name", request("clientId")));

        UserInfo userInfo = userInfo("sub");

        // when
        Map<String, Object> result = assembler.assembleFrom(accessToken, userInfo);

View Full Code Here

        // given
        OAuth2RefreshTokenEntity refreshToken = refreshToken(new Date(123),
                authentication("name", request("clientId", scopes("foo""bar"))));

        UserInfo userInfo = userInfo("sub");

        // when
        Map<String, Object> result = assembler.assembleFrom(refreshToken, userInfo);

View Full Code Here

        // given
        OAuth2RefreshTokenEntity refreshToken = refreshToken(null,
                authentication("name", request("clientId", scopes("foo""bar"))));

        UserInfo userInfo = userInfo("sub");

        // when
        Map<String, Object> result = assembler.assembleFrom(refreshToken, userInfo);

View Full Code Here

                .build();
        assertThat(result, is(equalTo(expected)));
    }

    private UserInfo userInfo(String sub) {
        UserInfo userInfo = mock(UserInfo.class);
        given(userInfo.getSub()).willReturn(sub);
        return userInfo;
    }
View Full Code Here

TOP

Related Classes of org.mitre.openid.connect.model.UserInfo

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.