Class OAuth2Client
java.lang.Object
org.nuxeo.ecm.platform.oauth2.clients.OAuth2Client
- Since:
- 5.9.2
- Author:
- Arnaud Kervern
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OAuth2Client
static DocumentModel
fromOAuth2Client
(OAuth2Client oAuth2Client) Creates aDocumentModel
from anOAuth2Client
.getId()
getName()
boolean
boolean
static boolean
isRedirectURIValid
(String redirectURI) A redirect URI is considered as valid if and only if: It is not empty It starts with https, e.g. https://my.redirect.uri It doesn't start with http, e.g. nuxeo://authorize It starts with http://localhost with localhost not part of the domain name, e.g. http://localhost:8080/nuxeo, a counter-example being http://localhost.somecompany.com The Nuxeo node is in Dev modeboolean
isValidWith
(String clientId, String clientSecret) toMap
(OAuth2Client oAuth2Client) Converts anOAuth2Client
to map structure.toString()
static DocumentModel
updateDocument
(DocumentModel documentModel, OAuth2Client oAuth2Client) Updates theDocumentModel
by theOAuth2Client
.
-
Field Details
-
NAME_FIELD
- Since:
- 11.1
- See Also:
-
ID_FIELD
- Since:
- 11.1
- See Also:
-
SECRET_FIELD
- Since:
- 11.1
- See Also:
-
REDIRECT_URI_FIELD
- Since:
- 11.1
- See Also:
-
AUTO_GRANT_FIELD
- Since:
- 11.1
- See Also:
-
ENABLED_FIELD
- Since:
- 11.1
- See Also:
-
REDIRECT_URI_SEPARATOR
- Since:
- 11.1
- See Also:
-
LOCALHOST_PATTERN
-
name
-
id
-
secret
-
redirectURIs
- Since:
- 9.2
-
autoGrant
protected boolean autoGrant- Since:
- 9.10
-
enabled
protected boolean enabled
-
-
Constructor Details
-
Method Details
-
getName
-
getId
-
getRedirectURIs
- Since:
- 9.2
-
isAutoGrant
public boolean isAutoGrant()- Since:
- 9.10
-
isEnabled
public boolean isEnabled() -
getSecret
- Since:
- 11.1
-
fromDocumentModel
-
isRedirectURIValid
A redirect URI is considered as valid if and only if:- It is not empty
- It starts with https, e.g. https://my.redirect.uri
- It doesn't start with http, e.g. nuxeo://authorize
- It starts with http://localhost with localhost not part of the domain name, e.g. http://localhost:8080/nuxeo, a counter-example being http://localhost.somecompany.com
- The Nuxeo node is in Dev mode
- Since:
- 9.2
-
isValidWith
-
fromOAuth2Client
Creates aDocumentModel
from anOAuth2Client
.- Parameters:
oAuth2Client
- theOAuth2Client
to convert- Returns:
- the
DocumentModel
corresponding to theOAuth2Client
- Since:
- 11.1
-
updateDocument
Updates theDocumentModel
by theOAuth2Client
.- Parameters:
documentModel
- the document model to updateoAuth2Client
- the new values of document- Returns:
- the updated
DocumentModel
- Throws:
NullPointerException
- if the documentModel or oAuth2Client isnull
- Since:
- 11.1
-
toMap
Converts anOAuth2Client
to map structure.- Parameters:
oAuth2Client
- theOAuth2Client
- Returns:
- a map representing the
OAuth2Client
- Since:
- 11.1
-
toString
-