Package com.illumon.iris.auth
Class LocalAuthenticationServerTokenFactoryFactory
java.lang.Object
com.illumon.iris.auth.LocalAuthenticationServerTokenFactoryFactory
- All Implemented Interfaces:
TokenAuthenticationClient,TokenFactoryFactory,TokenVerificationClient
public class LocalAuthenticationServerTokenFactoryFactory
extends Object
implements TokenFactoryFactory
Adapts a LocalAuthenticationServer to a TokenFactoryFactory.
This class is suitable for use when you need to use external services within an Authentication server module. This class is for use inside the authentication server process, so instead of making RPC calls it simply generates a client state with the given user and then can create tokens for that user without any actual authentication. The token factory may only be used for creating new tokens, not verifying tokens.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.enterprise.auth.TokenFactoryFactory
TokenFactoryFactory.TokenFactory -
Constructor Summary
ConstructorsConstructorDescriptionLocalAuthenticationServerTokenFactoryFactory(LocalAuthenticationServer localAuthenticationServer, String authenticatedUser, String effectiveUser) Create a TokenFactoryFactory using the LocalAuthentication server. -
Method Summary
Modifier and TypeMethodDescriptioncreateToken(String service) Create a new token for the specified servicecreateTokenForUser(String service, String operateAs) Create a new token for the specified service to operate as the specified usrgetTokenFactory(String service) Create a token factory for the provided servicegetTokenFactory(String service, String user) Create a token factory for the provided service and userbooleanverifyToken(String service, AuthToken token) Validate the specified token for the specified serviceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.enterprise.auth.TokenAuthenticationClient
createToken, createTokenForUserMethods inherited from interface io.deephaven.enterprise.auth.TokenFactoryFactory
close, getTokenFactory, getTokenFactory
-
Constructor Details
-
LocalAuthenticationServerTokenFactoryFactory
public LocalAuthenticationServerTokenFactoryFactory(LocalAuthenticationServer localAuthenticationServer, String authenticatedUser, String effectiveUser) Create a TokenFactoryFactory using the LocalAuthentication server.- Parameters:
localAuthenticationServer- the local authentication serverauthenticatedUser- the authenticated user to create tokens aseffectiveUser- the effective user to create tokens as
-
-
Method Details
-
createToken
Description copied from interface:TokenAuthenticationClientCreate a new token for the specified service- Specified by:
createTokenin interfaceTokenAuthenticationClient- Returns:
- A new auth token from the server
-
createTokenForUser
Description copied from interface:TokenAuthenticationClientCreate a new token for the specified service to operate as the specified usr- Specified by:
createTokenForUserin interfaceTokenAuthenticationClient
-
getTokenFactory
Description copied from interface:TokenFactoryFactoryCreate a token factory for the provided service- Specified by:
getTokenFactoryin interfaceTokenFactoryFactory- Parameters:
service- the service- Returns:
- the created
TokenFactory
-
getTokenFactory
Description copied from interface:TokenFactoryFactoryCreate a token factory for the provided service and user- Specified by:
getTokenFactoryin interfaceTokenFactoryFactory- Parameters:
service- the serviceuser- the user- Returns:
- the created
TokenFactory
-
verifyToken
Validate the specified token for the specified serviceNote: this implementation of TokenFactoryFactory does not verify tokens.
- Specified by:
verifyTokenin interfaceTokenVerificationClient- Returns:
- True if the token was valid, false otherwise
-