Login API

The Login API provides programmatic access to the Portal API (PAPI), allowing you to integrate login and authentication flows directly in your custom application. To access the API, request an access token or revoke an access token by accessing the OAuth 2.0 authorization endpoint.
apip43
The Login API provides programmatic access to the Portal API (PAPI), allowing you to integrate login and authentication flows directly in your custom application. To access the API, request an access token or revoke an access token by accessing the OAuth 2.0 authorization endpoint.
SSO (SAML or CA SSO) users cannot log in to
API Management SaaS
using the Login API; they have to use the
API Management SaaS
login page.
You cannot use PAPI to edit users who are mapped to multiple organizations.
You can retrieve the following using the Login API:
  • The scope and identifier of an application that was created through the Mobile Developer Console (MDC) by accessing the
    /application/{tenantId}
    endpoint
  • The session status of an OpenID application.
  • The details of an OpenID application user.
All requests and responses are in JSON format.
Get an Access Token
Follow these steps:
Retrieve client_id
The following example accesses the
application
RESTful resource from the
apim-ssg.dev.ca.com
CA API Gateway:
curl -k https://apim-ssg.dev.ca.com:8443/login/application/apim
A response similar to the following example is expected:
{
"apikey": "1234abc1c20ea555b59def43f7ebf01234",
"scope": "openid"
}
Use the client_id
Use the client_id with the OAuth 2 resource password flow, but do not include the client_secret.
The following code is an example of how to use the API:
curl 'https://apim-ssg-apim-trial1-uswest2.app.services.ostest1.dev.ca.com/login/auth/oauth/v2/token' --data
'client_id=5a6050112e77410a9ce2276c7c709643&grant_type=password&scope=OOB&username=sell2\test&password=CAdemo123!&login_hint=sell2'
Get Session and User Information
You can use the access token to retrieve session information and user info for a specific user.
Follow these steps:
  1. Retrieve session and user information for a specific user from the
    /openid/connect/v1/userinfo
    endpoint.
  2. Validate session information from the
    /connect/session/status
    endpoint.
Explore the Login API
Follow these steps:
  1. Go to Portal and select
    Publish
    .
  2. Select
    API Explorer
    .
    API Explorer is only accessible through the API Portal/Ingress tenant.
  3. Select
    Login API
    from the
    API
    drop-down list.
    Alternatively, download the login-swagger-4-1.json file, and then open the file in a Swagger UI console or editor.