Repository navigation
Add Device Grant flow Support - #140
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
🔀 Cross-SDK feature parityDoes this change need to ship in the other ThunderID SDKs too? This check stays red until one of these labels answers that:
Ports (DO NOT EDIT)
No sibling SDKs accounted for on this thread yet. Important Reply to this comment with this block, filled in. The boxes above tick A link can be a pull request or a tracked issue, written in full or as The contract is in the SDK development specification. |
488be89 to
eca7963
Compare
eca7963 to
3fba018
Compare
| }: DeviceGrantProps): ReactElement => { | ||
| const {applicationId, baseUrl, meta} = useThunderID(); | ||
| const {t} = useTranslation(preferences?.i18n); | ||
| const userCodeComponents = useMemo<EmbeddedFlowComponent[]>( |
There was a problem hiding this comment.
The code prompt comes from the application's configured Device Grant flow and the server checks the code belongs to that application. Since the verification URI already carries the application id, shall we drop the SDK built code form and the start with only the user code? Same for Vue.
| 'flowType' in payload && | ||
| payload.flowType === EmbeddedFlowType.DeviceGrant && | ||
| 'inputs' in payload && | ||
| ((typeof payload.applicationId === 'string' && payload.applicationId.trim().length > 0) || |
There was a problem hiding this comment.
Once the code only start is removed, lets make the application id required here and in the start payload type.
| headers: HeadersInit | undefined, | ||
| allowAccessDenied: boolean, | ||
| ): Promise<Record<string, unknown>> => { | ||
| const callbackUrl: string = new URL('/oauth2/auth/callback', endpoint).toString(); |
There was a problem hiding this comment.
This keeps only the origin for the callback URL, so a base URL with a path (e.g. behind a reverse proxy) breaks. Can't we reuse the callback handling in the sign in executor? It uses the base URL and already relays failures.
| transition: | ||
| border-color 0.2s ease, | ||
| box-shadow 0.2s ease; | ||
| transition: border-color 0.2s ease; |
There was a problem hiding this comment.
Why is the focus ring removed? This changes every text field in the SDK and removes the visible focus indicator. Lets revert this and the border radius change, they are unrelated to device grant.
|
|
||
| /* Device Grant */ | ||
| 'deviceGrant.prompt.heading': 'Enter the code shown on your device', | ||
| 'deviceGrant.prompt.description': 'Enter the verification code to continue.', |
There was a problem hiding this comment.
deviceGrant.prompt.description and deviceGrant.errors.start aren't used anywhere. The prompt keys also go away once the SDK built form is removed. Check other locales too.
Signed-off-by: Yathusiga27 <yathu2708@gmail.com>
3fba018 to
972d3a8
Compare
|
@Yathusiga27 Lets link the parity PRs once you have them ready. |
Moves @thunderid/react to 1.11.1 and @thunderid/react-router to 1.10.1 (@thunderid/browser 1.9.1 and @thunderid/javascript 1.10.1 follow transitively). These releases post the SSO sessions a flow's responses return on the authorization callback (thunder-id/javascript-sdks#147), so a sign-in through the Gate that asks for the device_sso scope now receives a device secret (thunder-id#6227). They also bring Device Grant support (thunder-id/javascript-sdks#140), an ouId prop on GroupMembers (thunder-id/javascript-sdks#146), and granted permissions read from the backend session in backend mode (thunder-id/javascript-sdks#148). Refs thunder-id#6144 Signed-off-by: ImalshaD <plid475@gmail.com>
Purpose
Adds Device Grant verification, allowing users to enter a code from their device and complete the server-described authorization flow in the browser.
Approach
@thunderid/javascript.Related Issues
Related PRs
Checklist
breaking changelabel added.parity/prs-raisedorparity/prs-not-neededadded.parity/prs-raised, the port links are posted as a reply on the parity check's comment.Security checks