-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use the same issuer in token and discovery responses #24
Changes from all commits
6a4e50b
5c243a3
e457841
37f6f87
fda41af
58b6ee0
869ca84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Route; | ||
use Illuminate\Support\Facades\URL; | ||
use Laravel\Passport\Passport; | ||
|
||
class DiscoveryController | ||
|
@@ -13,8 +14,10 @@ class DiscoveryController | |
*/ | ||
public function __invoke(Request $request) | ||
{ | ||
URL::forceScheme('https'); // for route() calls below | ||
|
||
$response = [ | ||
'issuer' => url('/'), | ||
'issuer' => 'https://' . $_SERVER['HTTP_HOST'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jeremy379 This broke my unit test which was calling it without a HTTP_HOST. Maybe a good idea to fallback on both to route('/'), so also for the Id & Access tokens? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @christiaangoossens @jeremy379 Same here. Since this is a Laravel package, I think we need to stop using $_SERVER variables, and use the Request object to obtain the needed urls. Made an issue #32 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello Request isn't directly available here, so I choose to provide option on how this should be filled. Here is a fix MR: #33 |
||
'authorization_endpoint' => route('passport.authorizations.authorize'), | ||
'token_endpoint' => route('passport.token'), | ||
'grant_types_supported' => $this->getSupportedGrantTypes(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should force the https here, we could use the default value from laravel and fallback on https only if missing.
Locally, we may want to work on unsecured connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair it was
'https://' . $_SERVER['HTTP_HOST']
before #13