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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<NuxeoOAuth2Token>
getTokens(String nxuser)
Gets the OAuth2 tokens for the given user.List<NuxeoOAuth2Token>
getTokens(String nxuser, NuxeoOAuth2TokenType type)
Gets the OAuth2 tokens from a given user name and a type.List<NuxeoOAuth2Token>
getTokens(NuxeoPrincipal principal)
Gets the oAuth2 tokens as the given principal.List<NuxeoOAuth2Token>
getTokens(NuxeoOAuth2TokenType type, NuxeoPrincipal principal)
Gets the oAuth2 tokens for a given type as the given principal.List<NuxeoOAuth2Token>
search(String query, NuxeoPrincipal principal)
Finds the oAuth2 tokens that match the givenquery
as the given principal.
-
-
-
Method Detail
-
getTokens
List<NuxeoOAuth2Token> getTokens(NuxeoPrincipal principal)
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
List<NuxeoOAuth2Token> getTokens(String nxuser)
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
List<NuxeoOAuth2Token> getTokens(NuxeoOAuth2TokenType type, NuxeoPrincipal principal)
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
List<NuxeoOAuth2Token> getTokens(String nxuser, NuxeoOAuth2TokenType type)
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
List<NuxeoOAuth2Token> search(String query, NuxeoPrincipal principal)
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
-
-