Package io.goobi.viewer.api.rest.v2.auth
Class AuthorizationFlowResource
java.lang.Object
io.goobi.viewer.api.rest.v2.auth.AuthorizationFlowResource
REST resource handling IIIF Access Control Service authorization flows and probe requests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessTokenService(String messageId, String origin) Token service.de.intranda.api.iiif.auth.v2.AuthProbeService2For testing purposes.handleProbePreflight(String pi, int order, String origin) handleProbePreflight(String pi, String filename, String origin) handleProbePreflightRecordResource(String pi, String privilege, String origin) Probe pre-flight endpoint for general record related resources.handleProbePreflightStructureResource(String pi, String logId, String privilege, String origin) Probe pre-flight endpoint for general record related resources.loginService(String origin) Access (login) service.logout()probeRecordResource(String pi, String privilege, String origin) Probe service endpoint for general record related resources.probeRecordStructureResource(String pi, String logId, String privilege, String origin) Probe service endpoint for general record related resources.probeResource(String pi, int order, String origin) Probe service endpoint (page PDF).probeResource(String pi, String origin) Probe service endpoint (METS resolver).probeResource(String pi, String filename, String origin) Probe service endpoint (image and text).
-
Constructor Details
-
AuthorizationFlowResource
-
-
Method Details
-
getServiceDescription
@GET @Produces("application/json") public de.intranda.api.iiif.auth.v2.AuthProbeService2 getServiceDescription()For testing purposes.- Returns:
AuthProbeService2
-
loginService
@GET @Path("/login") @Produces("text/html") public Response loginService(@QueryParam("origin") String origin) Access (login) service.- Parameters:
origin- Mandatory origin parameter from the client- Returns:
Response
-
accessTokenService
@GET @Path("/token") @Produces("text/html") public Response accessTokenService(@QueryParam("messageId") String messageId, @QueryParam("origin") String origin) throws com.fasterxml.jackson.core.JsonProcessingException Token service. Issues a bearer token, if conditions are met.- Parameters:
messageId- Client-generated message ID; Must be included in the responseorigin- Mandatory origin parameter from the client- Returns:
Response- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
handleProbePreflight
@OPTIONS @Path("/probe/{pi}/{filename}") @Produces("application/json") public Response handleProbePreflight(@PathParam("pi") String pi, @PathParam("filename") String filename, @HeaderParam("Origin") String origin) - Parameters:
pi- Record identifierfilename- Content file nameorigin- Client origin- Returns:
Response
-
probeResource
@GET @Path("/probe/{pi}/{filename}") @Produces("application/json") public Response probeResource(@PathParam("pi") String pi, @PathParam("filename") String filename, @HeaderParam("Origin") String origin) throws com.fasterxml.jackson.core.JsonProcessingException Probe service endpoint (image and text). The session will probably be different here from previous login/token queries.- Parameters:
pi- record identifierfilename- name of the content file to check access fororigin- value of the HTTP Origin header from the client request- Returns:
Response- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
handleProbePreflight
@OPTIONS @Path("/probe/pdf/{pi}/{page}") @Produces("application/json") public Response handleProbePreflight(@PathParam("pi") String pi, @PathParam("order") int order, @HeaderParam("Origin") String origin) - Parameters:
pi- Record identifierorder- Page numberorigin- Client origin- Returns:
Response
-
probeResource
@GET @Path("/probe/pdf/{pi}/{page}") @Produces("application/json") public Response probeResource(@PathParam("pi") String pi, @PathParam("order") int order, @HeaderParam("Origin") String origin) throws com.fasterxml.jackson.core.JsonProcessingException Probe service endpoint (page PDF). The session will probably be different here from previous login/token queries.- Parameters:
pi- Record identifierorder- Page numberorigin- HTTP Origin header value for CORS- Returns:
Response- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
probeResource
@GET @Path("/probe/resolver/{pi}") @Produces("application/json") public Response probeResource(@PathParam("pi") String pi, @HeaderParam("Origin") String origin) throws com.fasterxml.jackson.core.JsonProcessingException Probe service endpoint (METS resolver). The session will probably be different here from previous login/token queries.- Parameters:
pi- Record identifierorigin- Client origin- Returns:
Response- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
handleProbePreflightRecordResource
@OPTIONS @Path("/probe/{pi}/privilege/{privilege}") @Produces("application/json") public Response handleProbePreflightRecordResource(@PathParam("pi") String pi, @PathParam("privilege") String privilege, @HeaderParam("Origin") String origin) Probe pre-flight endpoint for general record related resources.- Parameters:
pi- Record identifierprivilege- name of the privilege to checkorigin- Client origin- Returns:
Response
-
probeRecordResource
@GET @Path("/probe/{pi}/privilege/{privilege}") @Produces("application/json") public Response probeRecordResource(@PathParam("pi") String pi, @PathParam("privilege") String privilege, @HeaderParam("Origin") String origin) throws com.fasterxml.jackson.core.JsonProcessingException Probe service endpoint for general record related resources.- Parameters:
pi- Record identifierprivilege- The privilege to checkorigin- Client origin- Returns:
Response- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
handleProbePreflightStructureResource
@OPTIONS @Path("/probe/{pi}/section/{logid}/privilege/{privilege}") @Produces("application/json") public Response handleProbePreflightStructureResource(@PathParam("pi") String pi, @PathParam("logid") String logId, @PathParam("privilege") String privilege, @HeaderParam("Origin") String origin) Probe pre-flight endpoint for general record related resources.- Parameters:
pi- Record identifierlogId- structure log idprivilege- privilege to checkorigin- Client origin- Returns:
Response
-
probeRecordStructureResource
@GET @Path("/probe/{pi}/section/{logid}/privilege/{privilege}") @Produces("application/json") public Response probeRecordStructureResource(@PathParam("pi") String pi, @PathParam("logid") String logId, @PathParam("privilege") String privilege, @HeaderParam("Origin") String origin) throws com.fasterxml.jackson.core.JsonProcessingException Probe service endpoint for general record related resources.- Parameters:
pi- Record identifierlogId- LOGIDprivilege- The privilege to checkorigin- Client origin- Returns:
Response- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
logout
-
generateCookie
- Returns:
- Cookie as string
-