How to get Anypoint Platform access token?

Viewed 34

I need access token of my anypoint platform which is deployed on on-prem servers and have platinum subscription. So, able to access things in Anypoint Platform as well. I mean, it is an Hybrid model. It is working fine with my trial account when i hit the below URL with my trail account creds. https://anypoint.mulesoft.com:443/accounts/login getting below response

{
"access_token": "9123-4e33-84df-abc124",
"token_type": "bearer",
"redirectUrl": "/home/"
}

but when i try with my client creds getting below response instead of access token in body.

 {
"url": "https://verify.salesforce.com/verify/",
"body": {
    "request": "eyJhFUzI1NiIsInR5cCI6Imp3dCIsImtpZCI6ImFueXBvaW50X2lhbV9wcm9kLWMyYy02NS0xNjYxNzMxMjI0Mjk5IiwidmVyIjoiMS4wIn0.eyJzdHkiOiJUZW5InRydXN0X3ZlcmlmaWVkX2RldmljZXMiOmZhbHNlLCJlbWFpbCI6IlNUaGlydXBhdGhpQEtDU291dGhlcm4uY29tIiw-E_-N4q4hBBkMq5NQ"
}
}
1 Answers

If the Anypoint Platform organization uses External Identity you can not use the login API because the login actually happens in your company Identity Provider (IdP). Usually the token is needed for automated access to APIs. You have two options:

  1. (not recommended) Get a bearer token from the IdP of your organization. You'll need to reach out to your organization administrator to learn if you are allowed to do that and how. It really depends on the implementation of the IdP.
  2. (recommended) Create a Connected App for the access that you need and then get a bearer token for the connected app.
Related