question

Element Developer avatar image
Element Developer asked ·

Getting "Login error Error: Authorization code was not issued for this application" in Auth Code Flow

Hi

I am in Authorization Code Flow to get access token.


I am getting the "Login error Error: Authorization code was not issued for this application" at the first step getting the authorization code. I did GET method and it did work for the other application and I wanted to make another application and this is not working.

It is Server/Web App so Authorization Code Flow should work for it.

Why I am getting this error? Anybody knows the answer?

authorizationerrortokenlogincode
2 comments
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Can you describe your problem better. I am not sure how to help when you said "I did GET method and it did work for the other application and I wanted to make another application and this is not working."

0 Likes 0 · ·

I guess I got those errors as auth code is expired. What should I do to refresh the auth code?

0 Likes 0 · ·
Phong Vu avatar image
Phong Vu answered ·

As you said you guessed that the access token is expired. In that case, use the refresh token to ask for a new access token. Post this body to the "auth" endpoint

{
  'grant_type' : 'refresh_token',
  'refresh_token' : "your refresh token"
}


4 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Is the endpoint literally as /auth/? or /restapi/oauth/authorize ?

0 Likes 0 · ·

'/restapi/oauth/token'

0 Likes 0 · ·

Hi I tried

curl -X POST "https://platform.devtest.ringcentral.com/restapi/oauth/token"; -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Basic <MyAuth>“ -d '{'grant_type':'refresh_token','refresh_token':"your refresh token"}'

but I am getting

 "error" : "invalid_request",  "errors" : [{    "errorCode" : "OAU-250",    "message" : "Unsupported grant type"  }  "error_description" : "Unsupported grant type" }


What I am doing wrong?

0 Likes 0 · ·
Show more comments
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

Here is the way to get access token from refresh token:

https://platform.devtest.ringcentral.com/restapi/oauth/token


username=<your user name>&password=<your password>&extension=<your extension>&grant_type=refresh_token&refresh_token=<your refresh token generated>

Now it will generate new access token from refresh token

2 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Content-Type : application/x-www-form-urlencoded;charset=UTF-8

Accept: application/json

Authorization: Basic <base64 clientid:client secret>


0 Likes 0 · ·

Thank you. But actually I was working on another app and trying auth code flow. But I am getting "Auth Code was not issued for this application" when getting auth code. W
hy is this happening and how can I get auth code? This app is browser-based so auth code flow should be working.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.