public interface AuthHandler
io.pravega.controller.server.rpc.auth.PasswordAuthHandler.
Each custom auth handler is registered with a unique name identifying a supported authentication scheme.
The client supplies authentication credentials formatted as per HTTP 1.1 (RFC 7235):
Authentication: <scheme> <token>
This is done by implementing `PravegaCredentials` interface and passing it to client calls.
The credentials are passed via the Authorization header. For gRPC, the header is passed via call metadata.
For REST, the credentials are passed as the value of the HTTP Authorization header.
For gRPC, the credentials are passed as the value of the Authorization header in call metadata.| Modifier and Type | Interface and Description |
|---|---|
static class |
AuthHandler.Permissions |
| Modifier and Type | Method and Description |
|---|---|
java.security.Principal |
authenticate(java.lang.String token)
Authenticates a given request.
|
AuthHandler.Permissions |
authorize(java.lang.String resource,
java.security.Principal principal)
Authorizes the access to a given resource.
|
java.lang.String |
getHandlerName()
Returns name of the handler.
|
void |
initialize(ServerConfig serverConfig)
Sets the configuration.
|
java.lang.String getHandlerName()
java.security.Principal authenticate(java.lang.String token)
throws AuthException
token - the credentials token passed via the Authorization header.AuthException - Exception of type AuthException thrown if there is any error.AuthHandler.Permissions authorize(java.lang.String resource, java.security.Principal principal)
resource - the resource that needs to be accessed.principal - the Principal which needs to be authorized. This is generally a Principal returned by an earlier
call to `authenticate` method.void initialize(ServerConfig serverConfig)
serverConfig - The server configuration.