cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3585
Views
20
Helpful
5
Replies

Unable to get authorization token

dmitriy.teslya
Level 1
Level 1

Hello,

I'm trying to use Cisco Support API for PSS, particularly EoX API.

I have successfully registered my app and use client_id and secret from here - https://apiconsole.cisco.com/apps/myapps

When I try to get an authorization code with this URL and POST method in Postman:

https://cloudsso.cisco.com/as/token.oauth2?grant_type=client_credentials&client_id= e5z3kfdbr3srkqzvzb6n33wj&client_secret=<secret>&response_type=code

I get this response:

 

{
    "error_description": "Invalid client or client credentials.",
    "error": "invalid_client"
}

I also tried GET method and this URL:

https://cloudsso.cisco.com/as/authorization.oauth2?response_type=code&grant_type=client_credentials&client_id= e5z3kfdbr3srkqzvzb6n33wj&client_secret=<secret>

This returns 400 - Unknown or invalid client_id

 

Below is the screenshot from API Console.

Screenshot 2020-07-28 at 15.09.13.png

Any advice would be appreciated.

 

 

 

1 Accepted Solution

Accepted Solutions

visxu
Cisco Employee
Cisco Employee
I created a another new application and it works with the new id and secret.
In the second creation, I just choose only one Grant Type : "Client Credentials"

View solution in original post

5 Replies 5

Javier Morales
Level 1
Level 1

Hi

 

Having the same problem...

Have the same problem......

20200804095337.png20200804095416.png

Hi,

 

I am not sure why you selecting "client_credentials" option for the grant. 
I see you didn't get the "auth_code" from your Cisco SSO login, also you are not adding it in the headers for the URL used to request the token (https://cloudsso.cisco.com/as/token.oauth2 )

 

Please check this post (it might help), it shows the correct steps to get the token:

https://community.cisco.com/t5/services-discussions/cisco-oauth-sso-get-user-information/m-p/3988113/highlight/true#M645

 

visxu
Cisco Employee
Cisco Employee
I created a another new application and it works with the new id and secret.
In the second creation, I just choose only one Grant Type : "Client Credentials"

Worked for me also.

 

I registered a new app and selected only "Client Credentials" as a Grant Type.

After that I was able to get an access token with POST request to this URL:

https://cloudsso.cisco.com/as/token.oauth2?grant_type=client_credentials&client_id=<key>&client_secret=<client_secret>

 

The reply was like this:

{
    "access_token": "<token>",
    "token_type": "Bearer",
    "expires_in": 3599
}
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: