public class OAuth2Object extends AbstractResource<ResourceTypeImpl>
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_JSON_NXENTITY |
static String |
TOKEN_DIR |
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 |
checkPermission() |
javax.ws.rs.core.Response |
deleteProvider(String providerId,
javax.servlet.http.HttpServletRequest request)
Deletes an OAuth2 service provider.
|
protected void |
deleteToken(DocumentModel token) |
javax.ws.rs.core.Response |
deleteToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request)
Deletes an OAuth2 Token.
|
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.
|
protected NuxeoOAuth2Token |
getToken(NuxeoOAuth2ServiceProvider provider,
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)
Retrieves an OAuth2 Token.
|
protected DocumentModel |
getTokenDoc(NuxeoOAuth2ServiceProvider provider,
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() |
javax.ws.rs.core.Response |
updateProvider(String providerId,
javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2ServiceProvider provider)
Updates an OAuth2 service provider.
|
protected NuxeoOAuth2Token |
updateToken(NuxeoOAuth2ServiceProvider provider,
String nxuser,
NuxeoOAuth2Token token) |
javax.ws.rs.core.Response |
updateToken(String providerId,
String nxuser,
javax.servlet.http.HttpServletRequest request,
NuxeoOAuth2Token token)
Updates an OAuth2 Token.
|
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 APPLICATION_JSON_NXENTITY
public static final String TOKEN_DIR
public OAuth2Object()
public List<NuxeoOAuth2ServiceProvider> getProviders(@Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response getProvider(String providerId, @Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response addProvider(@Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2ServiceProvider provider) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response updateProvider(String providerId, @Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2ServiceProvider provider) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response deleteProvider(String providerId, @Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response getToken(String providerId, @Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
public List<NuxeoOAuth2Token> getTokens(@Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response getToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response updateToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request, NuxeoOAuth2Token token) throws IOException, RestOperationException
IOException
RestOperationException
public javax.ws.rs.core.Response deleteToken(String providerId, String nxuser, @Context javax.servlet.http.HttpServletRequest request) throws IOException, RestOperationException
IOException
RestOperationException
protected List<NuxeoOAuth2ServiceProvider> getProviders()
protected NuxeoOAuth2ServiceProvider getProvider(String providerId) throws RestOperationException
RestOperationException
protected List<NuxeoOAuth2Token> getTokens()
protected List<NuxeoOAuth2Token> getTokens(String nxuser)
protected DocumentModel getTokenDoc(NuxeoOAuth2ServiceProvider provider, String nxuser) throws RestOperationException
RestOperationException
protected NuxeoOAuth2Token getToken(NuxeoOAuth2ServiceProvider provider, String nxuser) throws RestOperationException
RestOperationException
protected NuxeoOAuth2Token updateToken(NuxeoOAuth2ServiceProvider provider, String nxuser, NuxeoOAuth2Token token) throws RestOperationException
RestOperationException
protected void deleteToken(DocumentModel token) throws RestOperationException
RestOperationException
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() throws RestOperationException
RestOperationException
protected boolean hasPermission()
Copyright © 2017 Nuxeo. All rights reserved.