Developer

last person joined: 7 days ago 

Expand all | Collapse all

authentication working with client credentials but not with username + password credentials

This thread has been viewed 3 times
  • 1.  authentication working with client credentials but not with username + password credentials

    Posted Feb 10, 2020 03:14 AM

    I have a guest account to access the ClearPass API clients and REST API. So let's say my guest credentials are 

     

     

    username = myGuestUsername
    password = myGuestPassword

     

     

    with the following settings

     

    dunnoyetbutmaybelater_0-1581321768380.png

    When calling the REST API via
     

     

    https://clearpass.company.com:443/api/oauth​

     

    with my client credentials (changed grant type)
     
     

     

    {
    "grant_type": "client_credentials",
    "client_id": "myAPIClientID",
    "client_secret": "theGeneratedAPIClientSecret"
    }

     

     
    I get a valid access token. When I change the grant type to username and password and call the REST API with the body 
     

     

    {
    "grant_type": "password",
    "client_id": "myAPIClientID",
    "username": "myGuestUsername",
    "password": "myGuestPassword"
    }

     

     
    I get a 401 response
     

     

    {
      "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
      "title": "invalid_grant",
      "status": 401,
      "detail": "Invalid username and password combination"
    }

     

     
    I think using the guest credentials is not correct. Which credentials are correct? Is it possible to generate a username and password for the API client?
     
    I can access the API with the client credentials but other users might not have access to the client secret so I want them to log in with user credentials.
     
     
     
     


  • 2.  RE: authentication working with client credentials but not with username + password credentials

    MVP GURU
    Posted Feb 10, 2020 03:41 AM

    Hi,

     

    Do you have Add the Oauth2 API services ?



  • 3.  RE: authentication working with client credentials but not with username + password credentials

    Posted Feb 10, 2020 07:21 AM

    Hey,

    would you mind telling me where I can look it up?

     

    I'm just using ClearPass as a registered guest. 



  • 4.  RE: authentication working with client credentials but not with username + password credentials

    MVP GURU
    Posted Feb 10, 2020 07:56 AM

    on Configuration => Services, you need a Oauth2 service



  • 5.  RE: authentication working with client credentials but not with username + password credentials

    Posted Feb 13, 2020 05:45 AM

    Thanks but unfortunately I can't find it. I will ask for more permissions and reply later