public class DescribedOauth2Endpoint extends Object implements DescribableHandler
/api
- an API method that returns the username associated with the bearer token/authorize
- the standard OAuth 2.0 authorization endpoint/login
- logs the user in through HTTP basic authorization/token
- the standard OAuth 2.0 token endpointDescribable.Listener
Constructor and Description |
---|
DescribedOauth2Endpoint()
Create the endpoint.
|
Modifier and Type | Method and Description |
---|---|
void |
addDescriptorListener(Describable.Listener listener)
Add a listener for API Descriptor changes.
|
io.swagger.models.Swagger |
api(ApiProducer<io.swagger.models.Swagger> producer)
Provide the API description for the component.
|
Promise<Response,NeverThrowsException> |
handle(Context context,
Request request)
|
io.swagger.models.Swagger |
handleApiRequest(Context context,
Request request)
Handle a request for the API Descriptor.
|
void |
removeDescriptorListener(Describable.Listener listener)
Remove a listener from API Descriptor changes.
|
public Promise<Response,NeverThrowsException> handle(Context context, Request request)
Handler
Promise
representing the asynchronous Response
of the given request
.
If any (asynchronous) processing goes wrong, the promise still contains a Response
(probably from the
4xx or 5xx status code family).
A handler that doesn't hand-off the processing to another downstream handler is responsible for creating the response.
The returned Promise
contains the response returned from the server as-is.
This is responsibility of the handler to produce the appropriate error response (404,
500, ...) in case of processing error.
Note: As of Promise 2.0 implementation, it is not permitted to throw any runtime exception here. Doing so produce unexpected behaviour (most likely a server-side hang of the processing thread).
public io.swagger.models.Swagger api(ApiProducer<io.swagger.models.Swagger> producer)
Describable
api
in interface Describable<io.swagger.models.Swagger,Request>
producer
- The API producer that provides general information to be built into the descriptor.public io.swagger.models.Swagger handleApiRequest(Context context, Request request)
Describable
handleApiRequest
in interface Describable<io.swagger.models.Swagger,Request>
context
- The request context.request
- The request.public void addDescriptorListener(Describable.Listener listener)
Describable
addDescriptorListener
in interface Describable<io.swagger.models.Swagger,Request>
listener
- The listener.public void removeDescriptorListener(Describable.Listener listener)
Describable
removeDescriptorListener
in interface Describable<io.swagger.models.Swagger,Request>
listener
- The listener.Copyright © 2025 Open Identity Platform Community. All rights reserved.