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

dev/core#2141 - Multiple revisions to new screen for inspecting OAuth tokens #18943

Merged
merged 1 commit into from
Nov 7, 2020

Conversation

totten
Copy link
Member

@totten totten commented Nov 7, 2020

Overview

5.32 adds oauth-client, which includes a screen for inspecting OAuth tokens. It is intended to facilitate debugging.

This addresses some bugs/usability in the new screen.

Before

  • The screen works for inspecting one token. It offers a subform to inspect other tokens, but it doesn't work.
  • The screen only shows the access_token (and its JWT variant)

After

  • The malfunctioning subform isn't needed. Remove it.
  • The screen shows a full record of the token details. This should make it even more useful for debugging.

… tokens

Overview
--------

5.32 adds `oauth-client`, which includes a screen for inspecting OAuth
tokens.  This is intended to facilitate debugging.

Before
------

* The screen works for inspecting one token. It offers a button to inspect other tokens, but it doesn't work.
* The screen only shows the `access_token` (and its JWT variant)

After
-----

* The malfunctioning button isn't needed. Remove it.
* The screen shows a full record of the token details. This should make it even more useful for debuggin.
@civibot
Copy link

civibot bot commented Nov 7, 2020

(Standard links)

@civibot civibot bot added the 5.32 label Nov 7, 2020
@demeritcowboy
Copy link
Contributor

demeritcowboy commented Nov 7, 2020

I tried to test but I think maybe my token isn't a JWT token, although it sort of looks like one (it's gmail). I get a javascript console error Illegal base64url string! and the page displays the code literally {{token.access_token|unvalidatedJwtDecode|json}} at the bottom, although the output for the rest of the page is working, and it wasn't before the patch.

@totten
Copy link
Member Author

totten commented Nov 7, 2020

Yeah, the OAuth2 initiation doesn't guarantee that you'll get a JWT token. In my experience, Google's token wasn't JWT. That field is mainly for debugging Microsoft's token (which does happen to be JWT) for dev/mail#79.

@demeritcowboy
Copy link
Contributor

I think maybe in unvalidatedJwtDecode.js it could maybe do something - I was going to look at making a patch just went off to do something else.

Anyway I think this is mergeable, just there's a possible future improvement if the token isn't actually a JWT token.

@totten
Copy link
Member Author

totten commented Nov 7, 2020

@demeritcowboy Thanks. Agree the unvalidatedJwtDecode could fail better with non-JWT values (and that's orthogonal to this patch).

@totten totten merged commit 3bc561e into civicrm:5.32 Nov 7, 2020
@totten totten deleted the 5.32-token-inspect branch November 7, 2020 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants