public class OAuth2Object extends AbstractResource<ResourceTypeImpl>
Constructor and Description |
---|
OAuth2Object() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addProvider(javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2ServiceProvider provider)
Creates a new OAuth2 service provider.
|
protected javax.ws.rs.core.Response |
buildResponse(javax.ws.rs.core.Response.StatusType status,
Object obj) |
protected void |
checkNotAnonymousUser() |
protected void |
checkPermission(String nxuser) |
javax.ws.rs.core.Response |
deleteClientToken(String clientId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Deletes a oauth2 client token.
|
javax.ws.rs.core.Response |
deleteProvider(String providerId,
javax.servlet.http.HttpServletRequest request)
Deletes an OAuth2 service provider.
|
javax.ws.rs.core.Response |
deleteProviderToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Deletes an OAuth2 provider token.
|
protected void |
deleteToken(DocumentModel token) |
javax.ws.rs.core.Response |
deleteToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Deprecated.
since 10.2 Use
deleteProviderToken(String, String, HttpServletRequest) instead. |
protected OAuth2Client |
getClient(String clientId) |
javax.ws.rs.core.Response |
getClient(String clientId,
javax.servlet.http.HttpServletRequest request)
Retrieves a oauth2 client.
|
List<OAuth2Client> |
getClients(javax.servlet.http.HttpServletRequest request)
Retrieves oauth2 clients.
|
javax.ws.rs.core.Response |
getClientToken(String clientId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Retrieves a oauth2 client token.
|
List<NuxeoOAuth2Token> |
getClientUserTokens(javax.servlet.http.HttpServletRequest request)
Retrieves all oauth2 client tokens for the current user.
|
protected com.google.api.client.auth.oauth2.Credential |
getCredential(NuxeoOAuth2ServiceProvider provider,
NuxeoOAuth2Token token) |
protected NuxeoOAuth2ServiceProvider |
getProvider(String providerId) |
javax.ws.rs.core.Response |
getProvider(String providerId,
javax.servlet.http.HttpServletRequest request)
Retrieves oauth2 data for a given provider.
|
protected List<NuxeoOAuth2ServiceProvider> |
getProviders() |
List<NuxeoOAuth2ServiceProvider> |
getProviders(javax.servlet.http.HttpServletRequest request)
Lists all oauth2 service providers.
|
javax.ws.rs.core.Response |
getProviderToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Retrieves an OAuth2 provider token.
|
List<NuxeoOAuth2Token> |
getProviderUserTokens(javax.servlet.http.HttpServletRequest request)
Retrieves all oauth2 provider tokens for the current user.
|
protected NuxeoOAuth2Token |
getToken(NuxeoOAuth2ServiceProvider provider,
String nxuser) |
protected NuxeoOAuth2Token |
getToken(OAuth2Client client,
String nxuser) |
javax.ws.rs.core.Response |
getToken(String providerId,
javax.servlet.http.HttpServletRequest request)
Retrieves a valid access token for a given provider and the current user.
|
javax.ws.rs.core.Response |
getToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Deprecated.
since 10.2 Use
getProviderToken(String, String, HttpServletRequest) instead. |
protected DocumentModel |
getTokenDoc(NuxeoOAuth2ServiceProvider provider,
String nxuser) |
protected DocumentModel |
getTokenDoc(OAuth2Client client,
String nxuser) |
protected List<NuxeoOAuth2Token> |
getTokens() |
List<NuxeoOAuth2Token> |
getTokens(javax.servlet.http.HttpServletRequest request)
Retrieves all OAuth2 tokens.
|
protected List<NuxeoOAuth2Token> |
getTokens(String nxuser) |
protected boolean |
hasPermission(String nxuser) |
javax.ws.rs.core.Response |
updateClientToken(String clientId,
String nxuser,
javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2Token token)
Updates an OAuth2 client token.
|
javax.ws.rs.core.Response |
updateProvider(String providerId,
javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2ServiceProvider provider)
Updates an OAuth2 service provider.
|
javax.ws.rs.core.Response |
updateProviderToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2Token token)
Updates an OAuth2 provider token.
|
protected NuxeoOAuth2Token |
updateToken(NuxeoOAuth2ServiceProvider provider,
String nxuser,
NuxeoOAuth2Token token) |
protected NuxeoOAuth2Token |
updateToken(OAuth2Client client,
String nxuser,
NuxeoOAuth2Token token) |
javax.ws.rs.core.Response |
updateToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2Token token)
Deprecated.
since 10.2 Use
updateProviderToken(String, String, HttpServletRequest, NuxeoOAuth2Token)
instead. |
protected void |
updateTokenDoc(NuxeoOAuth2Token token,
DocumentModel entry) |
checkGuard, dispose, getActiveAdapter, getAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, initialize, isAdapter, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot, toString
public static final String TOKEN_DIR
public OAuth2Object()
public List<NuxeoOAuth2ServiceProvider> getProviders(@Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response getProvider(String providerId, @Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response addProvider(@Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2ServiceProvider provider)
public javax.ws.rs.core.Response updateProvider(String providerId, @Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2ServiceProvider provider)
public javax.ws.rs.core.Response deleteProvider(String providerId, @Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response getToken(String providerId, @Context javax.servlet.http.HttpServletRequest request) throws IOException
IOException
public List<NuxeoOAuth2Token> getTokens(@Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response getProviderToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request)
@Deprecated public javax.ws.rs.core.Response getToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request)
getProviderToken(String, String, HttpServletRequest)
instead.public javax.ws.rs.core.Response updateProviderToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2Token token)
@Deprecated public javax.ws.rs.core.Response updateToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2Token token)
updateProviderToken(String, String, HttpServletRequest, NuxeoOAuth2Token)
instead.public javax.ws.rs.core.Response deleteProviderToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request)
@Deprecated public javax.ws.rs.core.Response deleteToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request)
deleteProviderToken(String, String, HttpServletRequest)
instead.public List<NuxeoOAuth2Token> getProviderUserTokens(@Context javax.servlet.http.HttpServletRequest request)
public List<NuxeoOAuth2Token> getClientUserTokens(@Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response getClientToken(String clientId, String nxuser, @Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response updateClientToken(String clientId, String nxuser, @Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2Token token)
public javax.ws.rs.core.Response deleteClientToken(String clientId, String nxuser, @Context javax.servlet.http.HttpServletRequest request)
public List<OAuth2Client> getClients(@Context javax.servlet.http.HttpServletRequest request)
public javax.ws.rs.core.Response getClient(String clientId, @Context javax.servlet.http.HttpServletRequest request)
protected List<NuxeoOAuth2ServiceProvider> getProviders()
protected NuxeoOAuth2ServiceProvider getProvider(String providerId)
protected List<NuxeoOAuth2Token> getTokens()
protected List<NuxeoOAuth2Token> getTokens(String nxuser)
protected OAuth2Client getClient(String clientId)
protected DocumentModel getTokenDoc(NuxeoOAuth2ServiceProvider provider, String nxuser)
protected DocumentModel getTokenDoc(OAuth2Client client, String nxuser)
protected NuxeoOAuth2Token getToken(NuxeoOAuth2ServiceProvider provider, String nxuser)
protected NuxeoOAuth2Token getToken(OAuth2Client client, String nxuser)
protected NuxeoOAuth2Token updateToken(NuxeoOAuth2ServiceProvider provider, String nxuser, NuxeoOAuth2Token token)
protected NuxeoOAuth2Token updateToken(OAuth2Client client, String nxuser, NuxeoOAuth2Token token)
protected void updateTokenDoc(NuxeoOAuth2Token token, DocumentModel entry)
protected void deleteToken(DocumentModel token)
protected com.google.api.client.auth.oauth2.Credential getCredential(NuxeoOAuth2ServiceProvider provider, NuxeoOAuth2Token token)
protected javax.ws.rs.core.Response buildResponse(javax.ws.rs.core.Response.StatusType status, Object obj) throws IOException
IOException
protected void checkPermission(String nxuser)
protected boolean hasPermission(String nxuser)
protected void checkNotAnonymousUser()
Copyright © 2018 Nuxeo. All rights reserved.