<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00008FV1cRCATOkta Classic EngineAuthenticationAnswered2024-03-25T05:23:38.000Z2022-10-18T01:21:04.000Z2022-10-19T21:30:08.000Z

JieH.83243 (Customer) asked a question.

The client specified not to prompt, but the user is not logged in.

When trying to use username/password to get tokens, it failed with error

 

"The client specified not to prompt, but the user is not logged in."

 

 

 

(Some information below is redacted.)

 

 

 

Steps:

 

First, using authn api with username/password

 

Request: https://mycorp.okta.com/api/v1/authn

 

Response: {

 

 "_embedded" : {

 

 "user" : {

 

  "id" : "00u1uh2lmxApvW7",

 

  "profile" : {

 

  "login" : "myname@mycorp.com",

 

  "firstName" : "first name",

 

  "lastName" : "last name",

 

  "locale" : "en_US",

 

  "timeZone" : "America/Los_Angeles"

 

  }

 

 }

 

 },

 

 "_links" : {

 

 "cancel" : {

 

  "href" : "https://mycorp.okta.com/api/v1/authn/cancel",

 

  "hints" : {

 

  "allow" : [ "POST" ]

 

  }

 

 }

 

 },

 

 "sessionToken" : "201118BcixzEN-qtBAw0UBpjMvrxXPxJTrPJueZ0LZGVtQM_oBz",

 

 "expiresAt" : "2022-10-18T00:54:15.000Z",

 

 "status" : "SUCCESS"

 

}

 

Second, using /authorize api to get code

 

Request: https://mycorp.okta.com/oauth2/default/v1/authorize?scope=offline_access%20openid%20profile%20email&sessionToken=201118BcixzEN-qtBAw0UBpjMvrxXz97VPxJTrPZ0LZGVtQM_oBz&code_challenge=Ai35CG0K9WdhJlimYcihV6OTFu_UtXskHigLOtow&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ftsaaa%2Flogin-callback&prompt=none&response_mode=query&state=nmLVkziOXw_V15I1ts1WzQ&response_type=code&nonce=mOQNMhOpbzg&client_id=0oa1uh4g6h4S4tuWz697

 

Response: {

 

 "state" : "nmLVkziOXw_V15I1ts1WzQ",

 

 "error" : "login_required",

 

 "error_description" : "The client specified not to prompt, but the user is not logged in."

 

}

 

 

 

The same steps and codes worked for me on free account. But when switch to MYCORP (a paid account), it failed with upper error. The filled information are correct. (Such as client id, redirect url, etc..)

 

What I doubt it may be caused by company wide SSO/MFA settings. But since /authn API returns SUCCESS, my assumption is that the return sessionToken should work for /authorize.

 

Anything wrong? (I followed the help on https://support.okta.com/help/s/article/How-to-get-tokens-for-an-OIDC-application-without-a-browser-using-curlPostman?language=en_US)

 

 

 

Thanks

 


This question is closed.
Loading
The client specified not to prompt, but the user is not logged in.