python-oauth2
python-oauth2 copied to clipboard
[Request] Custom grant_types
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...
Hey @xamiax, I'm happy to look into this. The second link you posted is broken, can you fix?
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;
}
So is this doable, or should I look for an other solution? :/
@xamiax I'm going to take a quick look at this now and see if I can see how easy this could be