Interface ModelAuthProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides the credentials of each request that a model sends with the Micronaut HTTP client, for example a token
of the current user or a short-lived token in place of the API key of the model configuration.
The ModelAuthProvider beans are asked in order: the first value that is not null replaces the
Authorization header of the request. A provider is called on the thread that sends the request, so it can
read the context of the current HTTP request.
- Since:
- 2.4.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable Stringauthorization(ModelAuthRequest request) Returns the value of theAuthorizationheader of a request, for exampleBearer <token>.
-
Method Details
-
authorization
Returns the value of theAuthorizationheader of a request, for exampleBearer <token>.- Parameters:
request- The request of the model- Returns:
- The value of the
Authorizationheader, ornullto keep the credentials of the model
-