To login you need to use an a valid account who has permission to use the API.
Encrypting a plain text password
Link: https://au.itwocx.com/api/latest24.08/api/help/index#!/Login/Login_EncryptPassword
Logging In with Email and Password
Link: https://au.itwocx.com/api/latest24.08/api/help/index#!/Login/Login_ByEmail
By passing using a HTTP POST containing a json object containing a valid email address and encrypted password you will receive a session key which can be used for all other interactions..
Code Block |
---|
{
"Email": "example@mail.com",
"EncryptedPassword": "***encrypted***"
} |
Note |
---|
All requests require a valid user-agent header to pass through the web application firewall protecting iTWO cx. e.g. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 |
Logging In with Azure Active Directory (AD) - Single Sign On (SSO)
If the user you want to login as belongs to a company who has configured Single Sign On (SSO) - Azure AD, you will need to authenticate with Microsoft first to get a token which permits users to access the iTWOcx resource.
Authenticating with Microsoft to receive an Access Token is well documented here:
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overviewMore than likely you will want to use the AuthenticationContext.AcquireTokenSilentAsync method:https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.clients.activedirectory.authenticationcontext.acquiretokensilentasync?view=azure-dotnet
Depending on the authentication flow for the scenario being implemented you will need some or all of the following information:
Authority: https://login.microsoftonline.com/common
iTWOcx Resource: 52e5f8a4-8b0e-455f-9df4-5beb7c37dd18
ClientId: (GUID of the application configured for SSO in your Azure AD tenant)
ReturnUrl: https://au.itwocx.com/cxR/Authentication
Once you have an access token you would pass that token to iTWOcx by adding a header to the HTTP request called "Bearer" with the value of the header being the access token.:
Code Block |
---|
Authorization: Bearer {accessToken} |
This header against the following interface will then return a session key which can be used for all other interactions.
https://au.itwocx.com/api/latest24.08/api/help/index#!/Login/Login_ByUserToken
Tip | ||
---|---|---|
| ||
Using the session key
Link: https://au.itwocx.com/api/latest24.08/api/help/indexindex#!/
Copy & Paste the session key received from logging in into the api_key field in the top right hand corner and click Explore
Once the page refreshes you can then use any of the interfaces, to for example retrieve a list of Projects.