On my website admins can add external applications, so $oauth_client->id
and $url['url']
are correct in this case. To use the external apps users have to complete a simple registration form. After they complete it and click comfirm, then they get redirected to the authorization page. Everything works fine until after I click authorize.
$query = http_build_query([
'client_id' => $oauth_client->id,
'redirect_uri' => $url['url'],
'response_type' => 'token',
'scope' => '',
]);
return redirect(url('/').'/oauth/authorize?'.$query);
this is the url it redirects to: http://mywebsite.com/index.jsp#access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImVmOGYyYzcxYTI4ZmQwNm[...]&token_type=Bearer&expires_in=31536000
everything looks good except for the # after index.jsp
This is the autogenerated form for Authorization.
<form method="post" action="/oauth/authorize">
<input type="hidden" name="state" value="">
<input type="hidden" name="client_id" value="">
<button type="submit" class="btn btn-success btn-approve">Authorize</button>
</form>
NOTE: I tried using 'response_type' => 'code'
, but that wants username and password, and I don't want that.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire