use of com.authlete.common.dto.IntrospectionResponse in project java-oauth-server by authlete.
the class FAPI2BaseAccountsEndpoint method read.
@GET
public Response read(@Context HttpServletRequest request, @HeaderParam(X_FAPI_INTERACTION_ID) String incomingInteractionId) {
String code = "Accounts Read";
// Compute a value for the "x-fapi-interaction-id" HTTP response header.
String outgoingInteractionId = ObbUtils.computeOutgoingInteractionId(code, incomingInteractionId);
// Validate the access token.
AuthleteApi authleteApi = AuthleteApiFactory.getDefaultApi();
IntrospectionResponse info = ObbUtils.validateAccessToken(outgoingInteractionId, code, authleteApi, request, "fapi2base-accounts");
// Make sure that the access token has a "consent:{consentId}" scope.
ensureConsentScope(outgoingInteractionId, code, info);
// Build a response body.
ResponseAccountList body = buildResponseBody();
// Build a successful response.
return ObbUtils.ok(outgoingInteractionId, body);
}
use of com.authlete.common.dto.IntrospectionResponse in project java-oauth-server by authlete.
the class ResourcesEndpoint method read.
@GET
public Response read(@Context HttpServletRequest request, @HeaderParam(X_FAPI_INTERACTION_ID) String incomingInteractionId) {
String code = "Resources Read";
// Compute a value for the "x-fapi-interaction-id" HTTP response header.
String outgoingInteractionId = ObbUtils.computeOutgoingInteractionId(code, incomingInteractionId);
// Validate the access token.
AuthleteApi authleteApi = AuthleteApiFactory.getDefaultApi();
IntrospectionResponse info = ObbUtils.validateAccessToken(outgoingInteractionId, code, authleteApi, request, "resources");
// Make sure that the access token has a "consent:{consentId}" scope.
ensureConsentScope(outgoingInteractionId, code, info);
// Build a response body.
ResponseResourceList body = buildResponseBody();
// Build a successful response.
return ObbUtils.ok(outgoingInteractionId, body);
}
Aggregations