Skip to content

Add openid userinfo endpoint#115

Merged
DeepDiver1975 merged 2 commits intomasterfrom
add-openid-userinfo-endpoint
Feb 20, 2018
Merged

Add openid userinfo endpoint#115
DeepDiver1975 merged 2 commits intomasterfrom
add-openid-userinfo-endpoint

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

@DeepDiver1975 DeepDiver1975 commented Feb 16, 2018

@DeepDiver1975 DeepDiver1975 self-assigned this Feb 16, 2018
public function userInfo() {
$user = $this->userSession->getUser();
if ($user === null) {
throw new \Exception();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this Exception provide some details on why it was thrown?

$avatarUrl = $this->urlGenerator->getAbsoluteURL($avatarUrl);
$data = [
"sub" => $user->getUID(),
"picture" => $avatarUrl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"picture" could also be null if the avatar is unset; no? - I think it's better to return null than a URL that resolves into 404. Either that or link the generated avatar (the one with the letters)

So e.g. we can check for null for things like #95 instead of using a broken image link.

@DeepDiver1975 DeepDiver1975 force-pushed the add-openid-userinfo-endpoint branch from f4ee298 to 0672c05 Compare February 16, 2018 11:45
@DeepDiver1975 DeepDiver1975 changed the title [WIP] Add openid userinfo endpoint Add openid userinfo endpoint Feb 16, 2018
@DeepDiver1975 DeepDiver1975 added this to the development milestone Feb 16, 2018
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 16, 2018

Codecov Report

Merging #115 into master will increase coverage by 0.58%.
The diff coverage is 96.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #115      +/-   ##
============================================
+ Coverage     81.51%   82.09%   +0.58%     
- Complexity      186      194       +8     
============================================
  Files            20       21       +1     
  Lines           660      687      +27     
============================================
+ Hits            538      564      +26     
- Misses          122      123       +1
Impacted Files Coverage Δ Complexity Δ
lib/AuthModule.php 100% <100%> (ø) 7 <0> (ø) ⬇️
lib/Controller/OpenIdConnectController.php 96.29% <96.29%> (ø) 8 <8> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3aaacd8...c41fdd0. Read the comment docs.

}

$avatarUrl = $this->urlGenerator->linkTo('', 'remote.php');
$avatarUrl .= "/dav/avatars/{$user->getUID()}/96.jpeg";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

96.jpeg is some fixed value?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a good common practice value

@DeepDiver1975 DeepDiver1975 force-pushed the add-openid-userinfo-endpoint branch from 0672c05 to c6fd355 Compare February 19, 2018 10:58
@DeepDiver1975 DeepDiver1975 force-pushed the add-openid-userinfo-endpoint branch from c6fd355 to c41fdd0 Compare February 20, 2018 09:40
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

Successfully merging this pull request may close these issues.

4 participants