Class OAuthSessionDelegatingBearerGenerator
java.lang.Object
com.peterphi.std.guice.web.rest.auth.oauth2.OAuthSessionDelegatingBearerGenerator
- All Implemented Interfaces:
BearerGenerator
Bearer Token Generator that automatically generates User Manager Delegation Tokens for outgoing service calls it is assigned to
help with. It follows a simple ruleset:
- If this isn't a REST call, use own credentials (e.g. daemon operation)
- If this is a REST call but it's arriving from non-logged-in user then use own credentials (e.g. an openly-accessible landing page for a non-logged-in user)
- If this is a REST call but the caller is another service acting under their own authority, use own credentials
- If this is a REST call and not using OAuth (or User Manager API Tokens) then throw an exception and simply stop (generator is not intended for use in a mixed environment)
- Otherwise, create a delegation token (or pass along the one we received)
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
OAuthSessionDelegatingBearerGenerator
public OAuthSessionDelegatingBearerGenerator()
-
-
Method Details
-
setDefaultBearerToken
- Specified by:
setDefaultBearerToken
in interfaceBearerGenerator
-
getToken
- Specified by:
getToken
in interfaceBearerGenerator
-