Interface OAuth2TokenService
- All Known Implementing Classes:
OAuth2TokenServiceImpl
public interface OAuth2TokenService
Manages oAuth2 tokens. A token can be:
- Provided by Nuxeo, it's the oAuth2 server provider.
- Consumed by Nuxeo, it's a client of another server provider.
- Since:
- 11.1
-
Method Summary
Modifier and TypeMethodDescriptionGets the OAuth2 tokens for the given user.getTokens
(String nxuser, NuxeoOAuth2TokenType type) Gets the OAuth2 tokens from a given user name and a type.getTokens
(NuxeoPrincipal principal) Gets the oAuth2 tokens as the given principal.getTokens
(NuxeoOAuth2TokenType type, NuxeoPrincipal principal) Gets the oAuth2 tokens for a given type as the given principal.search
(String query, NuxeoPrincipal principal) Finds the oAuth2 tokens that match the givenquery
as the given principal.
-
Method Details
-
getTokens
Gets the oAuth2 tokens as the given principal.- Returns:
- the oAuth2 tokens
- Throws:
NuxeoException
- with 403 status code if the given principal doesn't have access to the oAuth2 tokens
-
getTokens
Gets the OAuth2 tokens for the given user.- Parameters:
nxuser
- the nuxeo user- Returns:
- the oAuth2 tokens that match the given user
- Throws:
NullPointerException
- ifnxuser
isnull
-
getTokens
Gets the oAuth2 tokens for a given type as the given principal.- Parameters:
type
- the token typeNuxeoOAuth2TokenType
- Returns:
- the oAuth2 tokens that match the type
- Throws:
NullPointerException
- iftype
isnull
NuxeoException
- with 403 status code if the given principal doesn't have access to the oAuth2 tokens
-
getTokens
Gets the OAuth2 tokens from a given user name and a type.- Parameters:
nxuser
- the nuxeo usertype
- the token typeNuxeoOAuth2TokenType
- Returns:
- the oAuth2 tokens
- Throws:
NullPointerException
- ifnxuser
ortype
isnull
-
search
Finds the oAuth2 tokens that match the givenquery
as the given principal. To be retrieved a token should match thequery
anywhere in the string value of the fieldsNuxeoOAuth2Token.KEY_NUXEO_LOGIN
,NuxeoOAuth2Token.KEY_SERVICE_NAME
- Parameters:
query
- the query to match- Returns:
- the oAuth2 tokens that match the
query
- Throws:
NuxeoException
- with 403 status code if the given principal doesn't have access to the oAuth2 tokens
-