Authentication (Login/Logout)

IAP/REST provides authentication methods allowing you to login and logout of the CMS, as well as update user passwords.  Before being able to make any IAP/REST calls, you need to be logged into the CMS. 

REST URL format is SmartServer-version specific

  • With SmartServer release 2.8 or higher, you do not have to specify the port number.

    https://<apollo_ip>/cms

  • With SmartServer 2.7 and prior, you have to specify the port number (8443).

    https://<apollo_ip>:8443/cms

URI Definition

Method

URI and Fields

Method

URI and Fields

GET

/iap/auth/sessionTimeout

Returns the timeout of the current user's session in milliseconds. 

Example

86400000                                                                                                    

POST

 

 

/iap/auth/login

Authenticates the user in the CMS. Returns information about the user, if the login operation is successful.

Request Header

"Content-type" must be set to "application/json".

Payload Arguments

Argument            

Description          

username

[string]  The username associated with the password for login purposes.

password

[string] The password associated with the username for login purposes.

Example

{                                                                                                                     
"username":"admin",
"password":"admin"
}

Response Parameters

Parameter

Description                 

id

[integer] The ID of the user.

userName

[string] The username associated with the password for login purposes.

firstName

[string] The user's first name.

lastName

[string] The user's last name.

emailAddress

[string] The email address associated with this username.

locale

[string] 

customerId

[integer] 

userType

[string] 

licenseAgreementAccepted   

[boolean] 

demoMode

[string] 

googleApiKey

[string] 

blocked

[boolean] True/False

Response Example

{                                                                                                                     
"id":1,
"userName":"admin",
"firstName":"System",
"lastName":"Administrator",
"emailAddress":"fake_email@localhost.net",
"locale":null,
"customerId":null,
"userType":"ADMIN",
"licenseAgreementAccepted":false,
"demoMode":"NO"
"googleApiKey":"AlzaSyBPoMK5jk-n4DWk1F_4amiUCWWyHi7Bo"
"blocked":false
}

PUT

 

/iap/auth/logout

Logs out the current user from CMS.

/iap/auth/resetPwd

Allows a user to reset a password. Sends an email to the user.

Payload Arguments

Argument                         

Description              

userName

[string] The username associated with the email address.

emailAddress    

[string] The email address associated with the username

Example

{                                                                                                                     
"userName":"admin",
"emailAddress":"emailaddress@localhost.net"
}

Query Parameters

Optional query parameters can be used with your REST request.  Specifying queries is described under Queries and ParametersPath Parameters, and Query Parameters.

Example

POST /iap/auth/login  {"username":"mark","password":"5pa?HG!O"}   

Response

{
"id":108,
"userName":"mark",
"firstName":"Mark",
"lastName":"Jones",
"emailAddress":"mark@demo.com",
"locale":null,
"customerId":101,
"userType":"OWNER",
"licenseAgreementAccepted":true,
"demoMode":"NO"
"googleApiKey":"AlzaSyBPoMK5jk-n4DWk1F_4amiUCWWyHi7Bo"
"blocked":false
}                                                                                                                                                                                                                        

 

 

 

 

Related content