Authentication Error - The endpoint does not support the provided HTTP method

Hello everybody,

I’m implementing authentication in Okta and the login page loads normally. But I have some errors.

This is the URL for the login page:

When I enter username and password, the error message returns:

This is the authenticated URL in Okta:

When accessing the URL the error message appears

“errorCode”: “E0000022”,
“errorSummary”: “The endpoint does not support the provided HTTP method”,
“errorLink”: “E0000022”,
“errorId”: “oaebDnffe31Qny6hmRCJKUnNQ”,
“errorCauses”: [

Can anyone help?

Are you trying to make a POST to the /token endpoint to exchange the authorization code (code URL param) sent back from Okta to the redirect_uri?

Hello @andrea ,

I’m trying to set the CURL return session, but I found that you don’t have CURL installed on the server, maybe that’s why the code is giving error.

$token_endpoint = $_ENV[‘OKTA_OAUTH2_ISSUER’].‘/v1/token’;

$ch = curl_init($token_endpoint);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
‘grant_type’ => ‘authorization_code’,
‘code’ => $_GET[‘code’],
‘code_verifier’ => $_SESSION[‘oauth_code_verifier’],
‘redirect_uri’ => $_ENV[‘OKTA_OAUTH2_REDIRECT_URI’],
‘client_id’ => $_ENV[‘OKTA_OAUTH2_CLIENT_ID’],
‘client_secret’ => $_ENV[‘OKTA_OAUTH2_CLIENT_SECRET’],

$response = json_decode(curl_exec($ch), true);

$_SESSION[‘okta_id_token’] = $response[‘id_token’];

Does not run CURL.