• Home
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • General
  • News & Announcements
  • Ideas
  • RingCentral Office
    • Getting Started
    • Authentication
    • App Graduation
    • API Betas & Developer Previews
    • REST API
      • Call Management API
      • Glip API
      • Meetings API
      • Messaging API (SMS, Fax, Voicemail)
      • Provisioning API
      • Voice and Telephony API
    • Environment (Sandbox, Gateway)
    • SDKs
    • Admin & Credentials
  • RingCentral Engage
    • Getting Started
    • REST API
      • Interactions API
      • Provisioning API
      • Routing API
  • Jobs/Requests for Help
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Users
  • Badges
Skip to main content
  • Create
    • Ask a question
    • Create an article
    • Post an idea
    • General
    • News & Announcements
    • Ideas
    • RingCentral Office
      • Getting Started
      • Authentication
      • App Graduation
      • API Betas & Developer Previews
      • REST API
        • Call Management API
        • Glip API
        • Meetings API
        • Messaging API (SMS, Fax, Voicemail)
        • Provisioning API
        • Voice and Telephony API
      • Environment (Sandbox, Gateway)
      • SDKs
      • Admin & Credentials
    • RingCentral Engage
      • Getting Started
      • REST API
        • Interactions API
        • Provisioning API
        • Routing API
    • Jobs/Requests for Help
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Sign in
  • Home
  • RingCentral Office
  • SDKs

question

Jeroen Couwenberg avatar image
Jeroen Couwenberg asked · Aug 20 at 12:13 PM

Ringcentral returns OAU-153 response

Hello,


We have implemented an implicit grant flow in our login authorization flow. However we have come across a problem when trying to logout. (We assume this is also the problem at other platform(). functions). For that function we use the following code:

function logout() {
    rcsdk.platform().logout()
        .then(function (res) {
            _isLoggedIn = false;
            console.log('rcClient logged out');
            rcWebPhone.userAgent.unregister();
            var onLogout = handlers["onLogout"];
            onLogout();
            loginstatus();
            subscriptionCache.resetSubscription();
        })
        .catch(function (res) {
            console.log('An error occurred while logging out rcClient');
        });
}

The catch catches an error with the following message: "Failed to execute 'fetch' on 'Window': Cannot construct a Request with a Request object that has already been used."

The API response is :

{
  "error" : "invalid_client",
  "errors" : [ {
    "errorCode" : "OAU-153",
    "message" : "Invalid client: ${client_id}"
  } ],
  "error_description" : "Invalid client: ${client_id}"
}


WE cannot pinpoint why it would say it is an invalid client_id because we can use other apicalls before the logout just fine.

I will add also the way we login to be complete in my information:

function show3LeggedLogin() {
    redirectUri = decodeURIComponent(window.location.href.split('rcclient.html', 1) + 'callback.html');
    console.log('Redirect uri: ', redirectUri);
    rcsdk = new SDK({
        appKey: appKey,
        server: server,
        redirectUri: redirectUri
    });
    platform = rcsdk.platform();
    var loginUrl = platform.loginUrl({ implicit: true });
    platform
        .loginWindow({ url: loginUrl }) // this method also allows to supply more options to control window position
        .then(function (loginOptions) {
            return platform.login(loginOptions);
        })
        .then(function (res) {
            // Login success
            return postLogin();
        })
        .catch(function (e) {
            // Login failed
            console.error(e.stack || e);
            var handleLoginFailed = handlers["loginFailed"];
            handleLoginFailed();
        });
}


I hope you can help us or at least steer us in the right direction to solve this. If you need more information please say so!


With kind regards,

Martijn (logged in under Jeroens name)

errorresponseimplicit grant flowoau-153
Comment
· 1 comment
1 |1000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

Phong Vu avatar image Phong Vu ♦♦ · Aug 23 at 02:57 PM

Just a quick check. Can you double check the rcsdk.platform() instance inside the logout function to see if it is instantiated? I guessed the rcsdk is a global variable but not sure how you implemented it.

0 · ·

0 Answers

· Write an Answer

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.

question details

2 People are following this question.

Jeroen3240542008 follows this question Phong1426275020 follows this question
Answers Subscribe to Answers Answers and Comments Subscribe to Comments and Answers
  • Developer Home
  • ·
  • Community Guidelines
  • ·
  • Legal
  • ·
  • Privacy Notice