use of io.gravitee.am.gateway.handler.oauth2.exception.UnsupportedTokenType in project gravitee-access-management by gravitee-io.
the class IntrospectionEndpoint method createRequest.
private static IntrospectionRequest createRequest(RoutingContext context) {
String token = context.request().getParam(ConstantKeys.TOKEN_PARAM_KEY);
String tokenTypeHint = context.request().getParam(ConstantKeys.TOKEN_TYPE_HINT_PARAM_KEY);
if (token == null) {
throw new InvalidRequestException();
}
IntrospectionRequest introspectionRequest = new IntrospectionRequest(token);
if (tokenTypeHint != null) {
try {
introspectionRequest.setHint(TokenTypeHint.from(tokenTypeHint));
} catch (IllegalArgumentException iae) {
throw new UnsupportedTokenType(tokenTypeHint);
}
}
return introspectionRequest;
}
Aggregations