Package com.nimbusds.oauth2.sdk.id

Examples of com.nimbusds.oauth2.sdk.id.Issuer


   
    for (String v: JSONObjectUtils.getStringArray(jsonObject, "subject_types_supported")) {
      subjectTypes.add(SubjectType.parse(v));
    }
   
    Issuer issuer = new Issuer(JSONObjectUtils.getURI(jsonObject, "issuer").toString());

    URI jwkSetURI = JSONObjectUtils.getURI(jsonObject, "jwks_uri");
   
   
    OIDCProviderMetadata op = new OIDCProviderMetadata(issuer, Collections.unmodifiableList(subjectTypes), jwkSetURI);
View Full Code Here


   *
   * @return The issuer.
   */
  public Issuer getIssuer() {

    return new Issuer(getStringClaim(ISS_CLAIM_NAME));
  }
View Full Code Here

    Date iat = null;

    if (jsonObject.containsKey("iat"))
      iat = DateUtils.fromSecondsSinceEpoch(JSONObjectUtils.getLong(jsonObject, "iat"));

    JWTID jti = null;

    if (jsonObject.containsKey("jti"))
      jti = new JWTID(JSONObjectUtils.getString(jsonObject, "jti"));


    // Check client ID

    if (! iss.getValue().equals(sub.getValue()))
View Full Code Here

    throws Exception {

    AuthorizationCode code = new AuthorizationCode();

    AuthenticationSuccessResponse response = new AuthenticationSuccessResponse(
      REDIRECT_URI, code, null, null, new State("abc"));

    assertEquals(REDIRECT_URI, response.getRedirectionURI());
    assertNull(response.getIDToken());
    assertEquals(code, response.getAuthorizationCode());
    assertNull(response.getAccessToken());
View Full Code Here

    ResponseType responseType = resp.impliedResponseType();
    assertTrue(new ResponseType("code").equals(responseType));

    Map<String,String> params = resp.toParameters();
    assertEquals(CODE, new AuthorizationCode(params.get("code")));
    assertEquals(STATE, new State(params.get("state")));
    assertEquals(2, params.size());

    URI uri = resp.toURI();

    HTTPResponse httpResponse = resp.toHTTPResponse();
View Full Code Here

    ResponseType responseType = resp.impliedResponseType();
    assertTrue(new ResponseType("token").equals(responseType));

    Map<String,String> params = resp.toParameters();
    assertEquals(TOKEN.getValue(), params.get("access_token"));
    assertEquals(STATE, new State(params.get("state")));
    assertEquals(TOKEN.getType(), new AccessTokenType(params.get("token_type")));
    assertEquals("3600", params.get("expires_in"));
    assertEquals(4, params.size());

    URI uri = resp.toURI();
View Full Code Here

      }
    }


    // Parse optional state third
    State state = State.parse(params.get("state"));


    // Parse mandatory response type
    v = params.get("response_type");
View Full Code Here

  public void testParseSuccess()
    throws Exception {

    URI redirectURI = new URI("https://example.com/in");
    AuthorizationCode code = new AuthorizationCode("123");
    State state = new State("xyz");

    AuthenticationSuccessResponse successResponse = new AuthenticationSuccessResponse(redirectURI, code, null, null, state);

    HTTPResponse httpResponse = successResponse.toHTTPResponse();
View Full Code Here

  public void testParseError()
    throws Exception {

    URI redirectURI = new URI("https://example.com/in");
    ResponseType rt = new ResponseType(ResponseType.Value.CODE);
    State state = new State("xyz");

    AuthenticationErrorResponse errorResponse = new AuthenticationErrorResponse(redirectURI, OAuth2Error.ACCESS_DENIED, rt, state);

    HTTPResponse httpResponse = errorResponse.toHTTPResponse();
View Full Code Here

    ErrorObject error = new ErrorObject(errorCode, errorDescription, HTTPResponse.SC_FOUND, errorURI);
   
   
    // State
    State state = State.parse(params.get("state"));
   
    return new AuthorizationErrorResponse(redirectURI, error, null, state);
  }
View Full Code Here

TOP

Related Classes of com.nimbusds.oauth2.sdk.id.Issuer

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.