- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 01:05 PM - edited 08-01-2023 01:44 PM
I wish to perform "oAuth 2.0 - Authorization Grant type", and I am following the steps laid out in KB0725643:
How to generate bearer token for oAuth 2.0 - Authorization Grant type
My problem is with the section "Generate Authorization Code".
The expected form order for authentication is "Authenticate" then "Allow," which would generate an "authorized code".
My attempt's form order is "Allow" then "Authenticate," which generates an "unauthorized code." Returning an error message: "You are not logged in, or your session has expired. Redirecting to the login page."
Application Registry OAuth
OAuth was created following the steps of KB0725643
Authentication Request
https://[DEV INSTANCE].service-now.com/oauth_auth.do?response_type=code&client_id=[CLIENT ID]&redirect_uri=https%3a%2f%2f[DEV INSTANCE].service-now.com%2flogin.do&state=12345
Redirected to "Allow" Page instead of expected "Authenticate" Page
KB0725643 expects initial redirection to oauth login page: /oauth_login.do.
Yet, instead redirected to oauth allow page: /oauth_auth_check.do.
https://[DEV INSTANCE].service-now.com/oauth_auth_check.do?sysparm_oauthapp_id=***
Redirected to Authenticate Page with unauthenticated code
With authentication code generated before authentication, this will be a problem:
https://dev105877.service-now.com/login.do?code=[Authentication Code]
Authenticate was successful
https://dev105877.service-now.com/now/nav/ui/classic/params/target/ui_page.do
As expected, the post "Allow" provided an authentication code before "Login," the authentication code would be invalid:
"You are not logged in, or your session has expired. Redirecting to the login page"
How to correct this problem?
How to correct so that as defined by KB0725643 "Generate Authorization Code" forms are the expected order "Authenticate" then "Allow", so that the authentication code is valid?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 10:47 AM
I resolved this by making the initial OAuth request within a cleared browser (empty of cookies).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 10:47 AM
I resolved this by making the initial OAuth request within a cleared browser (empty of cookies).