public class Client
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
accessToken
OAuth 2.0 Access Token
|
static java.lang.String |
CUSTOM_USER_AGENT |
protected java.lang.String |
error
Last error found
|
protected java.lang.String |
errorDescription
Description of last error found
|
protected org.joda.time.DateTime |
expiration
OAuth 2.0 Token expiration
|
int |
maxResults
Limit the number of elements returned in a search
|
protected java.lang.String |
refreshToken
OAuth 2.0 Refresh Token
|
protected Settings |
settings
Settings object
|
java.lang.String |
userAgent
The User-Agent to be used on requests
|
static java.lang.String |
VERSION |
Constructor and Description |
---|
Client() |
Client(int maxResults)
Constructs the client to execute Onelogin's API calls.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
assignRoleToUser(long id,
java.util.List<java.lang.Long> roleIds)
Assigns Role to User
|
void |
cleanError()
Clean error message
|
void |
createEvent(java.util.Map<java.lang.String,java.lang.Object> eventParams)
Create an event in the OneLogin event log.
|
java.lang.Object |
createSessionLoginToken(java.util.Map<java.lang.String,java.lang.Object> queryParams)
Generate a session login token in scenarios in which MFA may or may not be required.
|
java.lang.Object |
createSessionLoginToken(java.util.Map<java.lang.String,java.lang.Object> queryParams,
java.lang.String allowedOrigin)
Generates a session login token in scenarios in which MFA may or may not be required.
|
java.lang.String |
createSessionViaToken(java.lang.String sessionToken)
Post a session token to this API endpoint to start a session and set a cookie to log a user into an app.
|
User |
createUser(java.util.Map<java.lang.String,java.lang.Object> userParams)
Creates an user
|
java.lang.Boolean |
deleteUser(long id)
Deletes an user
|
java.lang.String |
generateInviteLink(java.lang.String email)
Generates an invite link for a user that you have already created in your OneLogin account.
|
void |
getAccessToken()
Generates an access token and refresh token that you may use to call Onelogin's API methods.
|
protected java.lang.String |
getAuthorization() |
protected java.lang.String |
getAuthorization(java.lang.Boolean bearer) |
protected java.util.Map<java.lang.String,java.lang.String> |
getAuthorizedHeader() |
protected java.util.Map<java.lang.String,java.lang.String> |
getAuthorizedHeader(java.lang.Boolean bearer) |
java.util.List<java.lang.String> |
getCustomAttributes()
Gets a list of all custom attribute fields (also known as custom user fields) that have been defined for OL account.
|
java.util.List<EmbedApp> |
getEmbedApps(java.lang.String token,
java.lang.String email)
Lists apps accessible by a OneLogin user.
|
java.lang.String |
getError() |
java.lang.String |
getErrorDescription() |
Event |
getEvent(long id)
Gets Event by ID.
|
java.util.List<Event> |
getEvents()
Gets a list of Event resources. (50 elements)
|
java.util.List<Event> |
getEvents(java.util.HashMap<java.lang.String,java.lang.String> queryParameters)
Gets a list of Event resources.
|
java.util.List<Event> |
getEvents(java.util.HashMap<java.lang.String,java.lang.String> queryParameters,
int maxResults)
Gets a list of Event resources.
|
java.util.List<Event> |
getEvents(int maxResults)
Gets a list of Event resources.
|
java.util.List<EventType> |
getEventTypes()
List of all OneLogin event types available to the Events API.
|
Group |
getGroup(long id)
Gets Group by ID.
|
java.util.List<Group> |
getGroups()
Gets a list of Group resources.
|
java.util.List<Group> |
getGroups(int maxResults)
Gets a list of Group resources (element of groups limited with the limit parameter).
|
RateLimit |
getRateLimit()
Gets current rate limit details about an access token.
|
Role |
getRole(long id)
Gets Role by ID.
|
java.util.List<Role> |
getRoles()
Gets a list of Role resources
|
java.util.List<Role> |
getRoles(java.util.HashMap<java.lang.String,java.lang.String> queryParameters)
Gets a list of Role resources.
|
java.util.List<Role> |
getRoles(java.util.HashMap<java.lang.String,java.lang.String> queryParameters,
int maxResults)
Gets a list of Role resources.
|
java.util.List<Role> |
getRoles(int maxResults)
Gets a list of Role resources.
|
SAMLEndpointResponse |
getSAMLAssertion(java.lang.String usernameOrEmail,
java.lang.String password,
java.lang.String appId,
java.lang.String subdomain)
Generates a SAML Assertion.
|
SAMLEndpointResponse |
getSAMLAssertion(java.lang.String usernameOrEmail,
java.lang.String password,
java.lang.String appId,
java.lang.String subdomain,
java.lang.String ipAddress)
Generates a SAML Assertion.
|
SAMLEndpointResponse |
getSAMLAssertionVerifying(java.lang.String appId,
java.lang.String devideId,
java.lang.String stateToken)
Verifies a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is required for SAML authentication.
|
SAMLEndpointResponse |
getSAMLAssertionVerifying(java.lang.String appId,
java.lang.String devideId,
java.lang.String stateToken,
java.lang.String otpToken)
Verifies a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is required for SAML authentication.
|
SAMLEndpointResponse |
getSAMLAssertionVerifying(java.lang.String appId,
java.lang.String devideId,
java.lang.String stateToken,
java.lang.String otpToken,
java.lang.String urlEndpoint)
Verifies a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is required for SAML authentication.
|
SessionTokenInfo |
getSessionTokenVerified(java.lang.String devideId,
java.lang.String stateToken)
Verify a one-time password (OTP) value provided for multi-factor authentication (MFA).
|
SessionTokenInfo |
getSessionTokenVerified(java.lang.String devideId,
java.lang.String stateToken,
java.lang.String otpToken)
Verify a one-time password (OTP) value provided for multi-factor authentication (MFA).
|
User |
getUser(long id)
Gets User by ID.
|
java.util.List<App> |
getUserApps(long id)
Gets a list of apps accessible by a user, not including personal apps.
|
java.util.List<java.lang.Integer> |
getUserRoles(long id)
Gets a list of role IDs that have been assigned to a user.
|
java.util.List<User> |
getUsers()
Gets a list of User resources
|
java.util.List<User> |
getUsers(java.util.HashMap<java.lang.String,java.lang.String> queryParameters)
Gets a list of User resources.
|
java.util.List<User> |
getUsers(java.util.HashMap<java.lang.String,java.lang.String> queryParameters,
int maxResults)
Gets a list of User resources.
|
java.util.List<User> |
getUsers(int maxResults)
Gets a list of User resources.
|
boolean |
isExpired() |
java.lang.Boolean |
lockUser(long id,
int minutes)
Use this call to lock a user’s account based on the policy assigned to the user,
for a specific time you define in the request, or until you unlock it.
|
java.lang.Boolean |
logUserOut(long id)
Log a user out of any and all sessions.
|
void |
prepareToken()
Prepare the client before execute a call to the API (get token ready)
|
void |
refreshToken()
Refreshing tokens provides a new set of access and refresh tokens.
|
java.lang.Boolean |
removeRoleFromUser(long id,
java.util.List<java.lang.Long> roleIds)
Remove Role from User
|
void |
revokeToken()
Revokes an access token and refresh token pair.
|
java.lang.Boolean |
sendInviteLink(java.lang.String email)
Send an invite link to a user that you have already created in your OneLogin account.
|
java.lang.Boolean |
sendInviteLink(java.lang.String email,
java.lang.String personalEmail)
Sends an invite link to a user that you have already created in your OneLogin account.
|
java.lang.Boolean |
setCustomAttributeToUser(long id,
java.util.Map<java.lang.String,java.lang.Object> customAttributes)
Set Custom Attribute Value
|
java.lang.Boolean |
setPasswordUsingClearText(long id,
java.lang.String password,
java.lang.String passwordConfirmation)
Sets Password by ID Using Cleartext
|
java.lang.Boolean |
setPasswordUsingHashSalt(long id,
java.lang.String password,
java.lang.String passwordConfirmation,
java.lang.String passwordAlgorithm)
Set Password by ID Using Salt and SHA-256
|
java.lang.Boolean |
setPasswordUsingHashSalt(long id,
java.lang.String password,
java.lang.String passwordConfirmation,
java.lang.String passwordAlgorithm,
java.lang.String passwordSalt)
Set Password by ID Using Salt and SHA-256
|
User |
updateUser(long id,
java.util.Map<java.lang.String,java.lang.Object> userParams)
Updates an user
|
public static final java.lang.String VERSION
public static final java.lang.String CUSTOM_USER_AGENT
protected java.lang.String accessToken
protected java.lang.String refreshToken
protected org.joda.time.DateTime expiration
protected java.lang.String error
protected java.lang.String errorDescription
protected Settings settings
public java.lang.String userAgent
public int maxResults
public Client(int maxResults) throws java.io.IOException, Error
java.io.IOException
Error
public void getAccessToken() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
public void refreshToken() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
public void revokeToken() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
public RateLimit getRateLimit() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
RateLimit
,
Get Rate Limit documentationpublic java.util.List<User> getUsers(java.util.HashMap<java.lang.String,java.lang.String> queryParameters, int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParameters
- Parameters to filter the result of the listmaxResults
- Limit the number of users returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
User
,
Get Users documentationpublic java.util.List<User> getUsers(java.util.HashMap<java.lang.String,java.lang.String> queryParameters) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParameters
- Parameters to filter the result of the listorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
User
,
Get Users documentationpublic java.util.List<User> getUsers(int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
maxResults
- Limit the number of users returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
User
,
Get Users documentationpublic java.util.List<User> getUsers() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
User
,
Get Users documentationpublic User getUser(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the userorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
User
,
Get User by ID documentationpublic java.util.List<App> getUserApps(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the userorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
App
,
Get Apps for a User documentationpublic java.util.List<java.lang.Integer> getUserRoles(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the userorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Role
,
Get Roles for a User documentationpublic java.util.List<java.lang.String> getCustomAttributes() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public User createUser(java.util.Map<java.lang.String,java.lang.Object> userParams) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
userParams
- User data (firstname, lastname, email, username, company, department, directory_id, distinguished_name,
external_id, group_id, invalid_login_attempts, locale_code, manager_ad_id, member_of, notes, openid_name,
phone, samaccountname, title, userprincipalname)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Object createSessionLoginToken(java.util.Map<java.lang.String,java.lang.Object> queryParams, java.lang.String allowedOrigin) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParams
- Query Parameters (username_or_email, password, subdomain, return_to_url, ip_address, browser_id)allowedOrigin
- Custom-Allowed-Origin-Header. Required for CORS requests only. Set to the Origin URI from which you are allowed to send a request using CORS.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Object createSessionLoginToken(java.util.Map<java.lang.String,java.lang.Object> queryParams) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParams
- Query Parameters (username_or_email, password, subdomain, return_to_url, ip_address, browser_id)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public SessionTokenInfo getSessionTokenVerified(java.lang.String devideId, java.lang.String stateToken, java.lang.String otpToken) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
devideId
- Provide the MFA device_id you are submitting for verification.stateToken
- Provide the state_token associated with the MFA device_id you are submitting for verification.otpToken
- Provide the OTP value for the MFA factor you are submitting for verification.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public SessionTokenInfo getSessionTokenVerified(java.lang.String devideId, java.lang.String stateToken) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
devideId
- Provide the MFA device_id you are submitting for verification.stateToken
- Provide the state_token associated with the MFA device_id you are submitting for verification.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.String createSessionViaToken(java.lang.String sessionToken) throws java.net.URISyntaxException, org.apache.http.client.ClientProtocolException, java.io.IOException
sessionToken
- The session tokenjava.net.URISyntaxException
java.io.IOException
org.apache.http.client.ClientProtocolException
public User updateUser(long id, java.util.Map<java.lang.String,java.lang.Object> userParams) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifieduserParams
- User data (firstname, lastname, email, username, company, department, directory_id, distinguished_name,
external_id, group_id, invalid_login_attempts, locale_code, manager_ad_id, member_of, notes, openid_name,
phone, samaccountname, title, userprincipalname)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean assignRoleToUser(long id, java.util.List<java.lang.Long> roleIds) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedroleIds
- Set to an array of one or more role IDs.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean removeRoleFromUser(long id, java.util.List<java.lang.Long> roleIds) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedroleIds
- Set to an array of one or more role IDs.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean setPasswordUsingClearText(long id, java.lang.String password, java.lang.String passwordConfirmation) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedpassword
- Set to the password value using cleartext.passwordConfirmation
- Ensure that this value matches the password value exactly.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean setPasswordUsingHashSalt(long id, java.lang.String password, java.lang.String passwordConfirmation, java.lang.String passwordAlgorithm, java.lang.String passwordSalt) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedpassword
- Set to the password value using a SHA-256-encoded value.passwordConfirmation
- This value must match the password value.passwordAlgorithm
- Set to salt+sha256.passwordSalt
- To provide your own salt value.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean setPasswordUsingHashSalt(long id, java.lang.String password, java.lang.String passwordConfirmation, java.lang.String passwordAlgorithm) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedpassword
- Set to the password value using a SHA-256-encoded value.passwordConfirmation
- This value must match the password value.passwordAlgorithm
- Set to salt+sha256.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean setCustomAttributeToUser(long id, java.util.Map<java.lang.String,java.lang.Object> customAttributes) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedcustomAttributes
- Provide one or more key value pairs composed of the custom attribute field shortname and the value that you want to set the field to.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean logUserOut(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean lockUser(long id, int minutes) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be modifiedminutes
- Set to the number of minutes for which you want to lock the user account. (0 to delegate on policy)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean deleteUser(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the user to be deletedorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.util.List<Role> getRoles(java.util.HashMap<java.lang.String,java.lang.String> queryParameters, int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParameters
- Parameters to filter the result of the listmaxResults
- Limit the number of roles returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Role
,
Get Roles documentationpublic java.util.List<Role> getRoles(java.util.HashMap<java.lang.String,java.lang.String> queryParameters) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParameters
- Parameters to filter the result of the listorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Role
,
Get Roles documentationpublic java.util.List<Role> getRoles(int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
maxResults
- Limit the number of roles returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Role
,
Get Roles documentationpublic java.util.List<Role> getRoles() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Role
,
Get Roles documentationpublic Role getRole(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the roleorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Role
,
Get Role by ID documentationpublic java.util.List<EventType> getEventTypes() throws java.net.URISyntaxException, org.apache.http.client.ClientProtocolException, java.io.IOException
java.net.URISyntaxException
java.io.IOException
org.apache.http.client.ClientProtocolException
EventType
,
Get Event Types documentationpublic java.util.List<Event> getEvents(java.util.HashMap<java.lang.String,java.lang.String> queryParameters, int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParameters
- Parameters to filter the result of the listmaxResults
- Limit the number of events returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Event
,
Get Events documentationpublic java.util.List<Event> getEvents(java.util.HashMap<java.lang.String,java.lang.String> queryParameters) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
queryParameters
- Parameters to filter the result of the listorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Event
,
Get Events documentationpublic java.util.List<Event> getEvents(int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
maxResults
- Limit the number of events returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Event
,
Get Events documentationpublic java.util.List<Event> getEvents() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Event
,
Get Events documentationpublic Event getEvent(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the eventorg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Event
,
Get Event by ID documentationpublic void createEvent(java.util.Map<java.lang.String,java.lang.Object> eventParams) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
eventParams
- Event Data (event_type_id, account_id, actor_system, actor_user_id, actor_user_name, app_id,
assuming_acting_user_id, custom_message, directory_sync_run_id, group_id, group_name, ipaddr,
otp_device_id, otp_device_name, policy_id, policy_name, role_id, role_name, user_id, user_name)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Event
,
Create Event documentationpublic java.util.List<Group> getGroups(int maxResults) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
maxResults
- Limit the number of groups returned (optional)org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Group
,
Get Groups documentationpublic java.util.List<Group> getGroups() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Group
,
Get Groups documentationpublic Group getGroup(long id) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
id
- Id of the grouporg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
Group
,
Get Group by ID documentationpublic SAMLEndpointResponse getSAMLAssertion(java.lang.String usernameOrEmail, java.lang.String password, java.lang.String appId, java.lang.String subdomain, java.lang.String ipAddress) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
usernameOrEmail
- username or email of the OneLogin user accessing the apppassword
- Password of the OneLogin user accessing the appappId
- App ID of the app for which you want to generate a SAML tokensubdomain
- subdomain of the OneLogin account related to the user/appipAddress
- whitelisted IP address that needs to be bypassed (some MFA scenarios).org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
SAMLEndpointResponse
,
Generate SAML Assertion documentationpublic SAMLEndpointResponse getSAMLAssertion(java.lang.String usernameOrEmail, java.lang.String password, java.lang.String appId, java.lang.String subdomain) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
usernameOrEmail
- username or email of the OneLogin user accessing the apppassword
- Password of the OneLogin user accessing the appappId
- App ID of the app for which you want to generate a SAML tokensubdomain
- subdomain of the OneLogin user accessing the apporg.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
SAMLEndpointResponse
,
Generate SAML Assertion documentationpublic SAMLEndpointResponse getSAMLAssertionVerifying(java.lang.String appId, java.lang.String devideId, java.lang.String stateToken, java.lang.String otpToken, java.lang.String urlEndpoint) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
appId
- App ID of the app for which you want to generate a SAML tokendevideId
- Provide the MFA device_id you are submitting for verification.stateToken
- Provide the state_token associated with the MFA device_id you are submitting for verification.otpToken
- Provide the OTP value for the MFA factor you are submitting for verification.urlEndpoint
- Specify an url where return the response.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
SAMLEndpointResponse
,
Verify Factor documentationpublic SAMLEndpointResponse getSAMLAssertionVerifying(java.lang.String appId, java.lang.String devideId, java.lang.String stateToken, java.lang.String otpToken) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
appId
- App ID of the app for which you want to generate a SAML tokendevideId
- Provide the MFA device_id you are submitting for verification.stateToken
- Provide the state_token associated with the MFA device_id you are submitting for verification.otpToken
- Provide the OTP value for the MFA factor you are submitting for verification.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
SAMLEndpointResponse
,
Verify Factor documentationpublic SAMLEndpointResponse getSAMLAssertionVerifying(java.lang.String appId, java.lang.String devideId, java.lang.String stateToken) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
appId
- App ID of the app for which you want to generate a SAML tokendevideId
- Provide the MFA device_id you are submitting for verification.stateToken
- Provide the state_token associated with the MFA device_id you are submitting for verification.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
SAMLEndpointResponse
,
Verify Factor documentationpublic java.lang.String generateInviteLink(java.lang.String email) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
email
- Set to the email address of the user that you want to generate an invite link for.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean sendInviteLink(java.lang.String email, java.lang.String personalEmail) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
email
- Set to the email address of the user that you want to send an invite link for.personalEmail
- If you want to send the invite email to an email other than the one provided in email,
provide it here. The invite link will be sent to this address instead.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.lang.Boolean sendInviteLink(java.lang.String email) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, java.net.URISyntaxException
email
- Set to the email address of the user that you want to send an invite link for.org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
java.net.URISyntaxException
public java.util.List<EmbedApp> getEmbedApps(java.lang.String token, java.lang.String email) throws java.net.URISyntaxException, org.apache.http.client.ClientProtocolException, java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, javax.xml.xpath.XPathExpressionException
token
- Provide your embedding token.email
- Provide the email of the user for which you want to return a list of apps to be embed.java.net.URISyntaxException
java.io.IOException
org.apache.http.client.ClientProtocolException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
javax.xml.xpath.XPathExpressionException
App
,
Get Apps to Embed for a User documentationpublic void prepareToken() throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemException
public boolean isExpired()
public java.lang.String getError()
public java.lang.String getErrorDescription()
public void cleanError()
protected java.util.Map<java.lang.String,java.lang.String> getAuthorizedHeader(java.lang.Boolean bearer)
protected java.util.Map<java.lang.String,java.lang.String> getAuthorizedHeader()
protected java.lang.String getAuthorization(java.lang.Boolean bearer)
protected java.lang.String getAuthorization()