Hello!
I’m trying to obtain additional claims for a users (e.g given_name) by invoking the userinfo API, shown below:
https://dev-60265957.okta.com/oauth2/v1/userinfo
However, when I try this via curl, it returns this error message:
“The authorization server id is invalid”
As far as I can tell, the bearer token is valid. Here is a screenshot of the bearer token:
I’m using curl from a windows batch file to test (since Spring Boot doesn’t show the detail of the errors).
Here are the contents of the batch file:
@echo off
REM Define variables
set ACCESS_TOKEN=eyJra…
set URL=https://dev-60265957.okta.com/oauth2/v1/userinfo
set OUTPUT_FILE=response.txt
REM Call the user info endpoint using curl, output to file
curl -X GET ^
-H “Authorization: Bearer %ACCESS_TOKEN%” ^
-H “Content-Type: application/json” ^
%URL% ^
–verbose > %OUTPUT_FILE%
REM Output the response to the console
if exist %OUTPUT_FILE% (
echo Response from server:
type %OUTPUT_FILE%
) else (
echo No response file was created.
)
REM Check if the request was successful
if %errorlevel% equ 0 (
echo Request successful. Response written to %OUTPUT_FILE%.
) else (
echo Request failed. Please check the access token or endpoint URL.
)
REM Prevent the window from closing immediately
pause
Here is the output:
Any idea what I’m doing wrong?