The most common forms of authentication to use with REST API are:
- Native - (MaxUser Tables)
- LDAP - (Directory service authentication)
System Property |
||
|
mxe.useAppSecurity |
0 |
URL call |
||
|
http://localhost/maximo/oslc/login |
|
Request Headers |
||
|
MAXAUTH |
<BASE64encoded user:password> |
Response in Return |
||
|
JSESSIONID |
As cookie to maintain the same session |
The Below System property tells us the application security is ON.
System Property |
||
|
mxe.useAppSecurity |
1 |
in LDAP Maximo uses directory authentication and validates users' credentials from the directory configured in WebSphere.
In this case, security settings are defined in WEB.XML file in below mentioned 4 files
maximo/application/maximoweb.xml maximo/application/maxrestweb.xml maximo/application/mboweb.xml maximo/application/meaweb.xml
in these files <login-config> section needs to be uncommented to use either FORM or BASIC authentication.
- Form (User Login Form but it will authenticate from a directory)
- Basic Authentication
System Property |
||
|
mxe.useAppSecurity |
1 |
First URL call to authenticate |
||
|
http://localhost/maximo/j_security_check |
|
Parameters |
||
|
j_username |
<userid> |
|
j_password |
<password> |
Response in Return |
||
|
LtpaToken2 |
|
|
JSESSIONID |
As cookie to maintain the same session |
|
|
|
When <login-form> is enabled for form authentication then first we have to call URL /maximo/j_security_check with parameters j_username and j_password same LDAP credentials. In response, we will lptatoken2 and jsessionid and other cookies returned will be used to get data from subsequent calls.
For Subsequent Calls |
||
URL |
/maximo/ |
No need of j_security_check. |
Parameters |
j_username |
|
|
j_password |
|
For subsequent calls, only j_username and j_password parameters are required without /j_security_check.
But remember first time /j_security_check is required because it returns LTPA Token.
If you are using the form on MAXIMO UI but you don't wanna use j_security_check in APIs then use /maxrest/oslc context root instead of maximo/oslc.
2. Basic Authentication
System Property |
||
|
mxe.useAppSecurity |
1 |
URL call |
||
|
http://localhost/maximo/oslc/login |
|
Request Headers |
||
|
Authorization |
BASIC <BASE64encoded user:password> |
Response in Return |
||
|
LtpaToken2 |
|
|
JSESSIONID |
As cookie to maintain the same session |
TIP: During deployment, you can use both Form and Basic:
- for maximouiweb -> form based
- for maxrest -> basic
like form is for UI and basic is for maxrest.
There are 2 system properties that define URL for each type
System Property |
||
|
mxe.oslc.restwebappurl |
|
|
mxe.oslc.webappurl |
Are these 2 System Properties simply informational or do they actually do something?
ReplyDeleteInformational for us to use with the rest calls
DeleteI was referring to the mxe.oslc.restwebappurl and mxe.oslc.webappurl System Properties.
ReplyDelete