docs: reframe GoogleJwtResolver as the demo-role hack it actually is#44
Merged
docs: reframe GoogleJwtResolver as the demo-role hack it actually is#44
Conversation
The sample's presence of GoogleJwtResolver.cs was sending the wrong
signal — implying that using Google with Trax requires writing a custom
resolver. It doesn't. AddTraxJwtAuth("https://accounts.google.com", id)
plus the default resolver is the whole integration for any app whose
roles live in standard claims.
This sample only overrides the resolver to hand every signed-in Google
user the Player role so the trains are exercisable. The updates:
- GoogleJwtResolver.cs: extensive remarks on "when you don't need a
custom resolver" (most apps) vs the four scenarios that justify one
(non-standard role claims, DB enrichment, allow-lists, transformation).
Marks the class as internal sealed to de-emphasize it as a template.
- Program.cs header + inline comment: lead with the one-line path and
call out the sample's custom resolver as a demo-only deviation.
- Web sample README: rewrites the warning to say "most apps don't need
this" rather than "do not copy".
9dd3f9c to
add8084
Compare
|
This PR is included in version 1.21.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #43. The sample's `GoogleJwtResolver.cs` was sending the wrong signal — implying that using Google with Trax requires writing a custom resolver. It doesn't. `AddTraxJwtAuth("https://accounts.google.com\", id)` plus the default resolver is the whole integration for any app whose roles live in standard claims.
This sample only overrides the resolver because it hard-assigns the `Player` role to every signed-in Google user so the trains are exercisable. Pairs with Trax.Docs#74 which adds a "Do you actually need a custom resolver?" section to the SDK reference.
Changes:
No functional changes. Pure documentation and commentary.
Test plan