Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Request] Custom grant_types #185

Open
xamiax opened this issue Aug 4, 2015 · 4 comments
Open

[Request] Custom grant_types #185

xamiax opened this issue Aug 4, 2015 · 4 comments

Comments

@xamiax
Copy link

xamiax commented Aug 4, 2015

I need to use this API. But they are using a custom grant_type (http://scoilnet.com/grants/apikey)

It would be grand, if you could implement an additional (optional) parameter to set a custom grant_type if needed...

@rickhanlonii
Copy link
Collaborator

Hey @xamiax, I'm happy to look into this. The second link you posted is broken, can you fix?

@xamiax
Copy link
Author

xamiax commented Aug 5, 2015

hey thanks for your effort! the second link IS actually the grant_type. As written in the API documentation. maybe the php sdk they provide could be helpful to get it done.

Here is how they manage the grant type there:

private function getAccessTokenFromApiKey($apiKey) {
    if ($this->getVariable('access_token_uri') && $this->getVariable('client_id') && $this->getVariable('client_secret')) {
      return json_decode($this->makeRequest(
        $this->getVariable('access_token_uri'),
        'POST',
        array(
          'grant_type' => 'http://scoilnet.com/grants/apikey',
          'client_id' => $this->getVariable('client_id'),
          'client_secret' => $this->getVariable('client_secret'),
          'api_key' => $apiKey,
        )
      ), TRUE);
    }
    return NULL;
  }

@xamiax
Copy link
Author

xamiax commented Aug 13, 2015

So is this doable, or should I look for an other solution? :/

@jaitaiwan
Copy link
Contributor

@xamiax I'm going to take a quick look at this now and see if I can see how easy this could be

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants