Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to integrate with backend and pass custom OAuth claims back to the client #65

Open
liverpoolfc-fan opened this issue May 9, 2017 · 1 comment

Comments

@liverpoolfc-fan
Copy link

While I am comfortable with PHP in general, I am not familiar with the PHP framework your code uses.

I would like to customize the OpenID connect sample implementation on the server side to authenticate against our own backend system and to provide custom Oauth claims back to the client in the output Token.

Where do I go about doing this?

I can see references to $params['scope'] as possibly referring to custom data to be added but I cannot see where this ever gets set. Perhaps it is totally unrelated.

It would be useful to add high level instructions for the integration points in the readme referring to the modules to modify, and to add some commented out pseudo code where the integration should be done, and in what format the data should be returned by the backend so as to be usable by the library.

Are there flags/settings that determine whether the Token is Signed and/or Encrypted?

Thanks in advance. And apologies if these are basic questions.

@josematheus10
Copy link

josematheus10 commented Mar 10, 2020

Hi,
Try something like this:

$this->server->addGrantType(new OAuth2\GrantType\AuthorizationCode($this->storage));
$this->server->handleAuthorizeRequest($this->request, $this->response, $is_authorized, $user_id );
if ($is_authorized) {
         $code = substr($this->response->getHttpHeader('Location'), strpos($this->response->getHttpHeader('Location'), 'code=')+5, 40);
	  header("Location: ".$this->response->getHttpHeader('Location'));
}
$this->response->send();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants