Search code examples
azurepostmanokta

okta trying to retrieve token in postman


Using this article

Trying to retrieve Okta token using postman but getting

"Invalid value for 'client_id' parameter."

I know the client_id is correct because it successfully works when I manually test my Azure function in Azure.

Plus, I can manually generate a token in Okta and then put that in the function call with client_id and client_secret in Postman and that works fine.

I'm using a Post http method.

enter image description here


Solution

  • I tried to reproduce the same in my environment and got the same error like below:

    enter image description here

    The error "Invalid value for 'client_id' parameter" usually occurs if you are passing invalid Client_ID value.

    Make sure you are passing the values from the Okta Portal like below:

    enter image description here

    When I passed the correct values, I am able to generate the access token successfully using the below Parameters:

    https://XXXX.okta.com/oauth2/default/v1/token
    
     
    
    client_id:ClientId
    client_secret:ClientSecret
    grant_type:client_credentials
    scope:scope
    

    enter image description here

    I created an Azure HTTP Trigger1, and selected the HTTP methods like below:

    enter image description here

    I am able to call the Azure Function Trigger successfully like below:

    https://xxx.azurewebsites.net/api/HttpTrigger1
    
     
    
    token:token
    client_id:ClientID
    client_secret:****
    

    enter image description here