use of org.forgerock.openam.sts.rest.token.provider.oidc.OpenIdConnectTokenCreationState in project OpenAM by OpenRock.
the class TokenRequestMarshallerImpl method createOpenIdConnectTokenProviderParameters.
private RestTokenProviderParameters<OpenIdConnectTokenCreationState> createOpenIdConnectTokenProviderParameters(final TokenTypeId inputTokenType, final JsonValue inputToken, final JsonValue desiredToken) throws TokenMarshalException {
org.forgerock.openam.sts.user.invocation.OpenIdConnectTokenCreationState userSpecifiedTokenCreationState = org.forgerock.openam.sts.user.invocation.OpenIdConnectTokenCreationState.fromJson(desiredToken);
if (!userSpecifiedTokenCreationState.getAllowAccess()) {
throw new TokenMarshalException(ResourceException.BAD_REQUEST, "The OpenIdConnectTokenCreation state must " + "indicate access to the caller's identity with a field of allow_access:true.");
}
final OpenIdConnectTokenCreationState openIdConnectTokenCreationState = new OpenIdConnectTokenCreationState(userSpecifiedTokenCreationState.getNonce(), System.currentTimeMillis() / 1000);
return new OpenIdConnectRestTokenProviderParameters(openIdConnectTokenCreationState, inputTokenType, inputToken);
}
Aggregations