Jump to content

How to do if tokenEndpoint returns string instead of json?


icedream

Recommended Posts

Posted

Hi,

When implicating a new OAuth 2.0 based login handler, I get some problems, as tokenEndpoint returns string not json data.

For example, in Facebook

GET https://graph.facebook.com/v3.2/oauth/access_token?
   client_id={app-id}
   &redirect_uri={redirect-uri}
   &client_secret={app-secret}
   &code={code-parameter}

will return

{
  "access_token": {access-token}, 
  "token_type": {type},
  "expires_in":  {seconds-til-expiration}
}

But in this case, it returns

access_token={access-token}&token_type={type}&expires_in={seconds-til-expiration}

I have no idea how to support this handler, could anyone help?

Posted

You will likely need to create a new login handler class that extends the OAuth2\Custom class, and override _handleAuthorizationResponse() method (defined in \IPS\Login\OAuth2)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...