-
Notifications
You must be signed in to change notification settings - Fork 2
ENG-31: Solid-OIDC Client Id Document support #17
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
Changes from all commits
818404c
58741de
6582061
9f1e4a3
e2b3203
1534f1a
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "token_endpoint_auth_method": "none", | ||
| "client_id": "http://localhost:8080/id.jsonld", | ||
| "redirect_uris": [ | ||
| "http://localhost:8080/callback.html" | ||
| ], | ||
| "response_types": [ | ||
| "code" | ||
| ], | ||
| "@context": "https://www.w3.org/ns/solid/oidc-context.jsonld" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| CachingAuthorizationServerProvider, | ||
| CachingClientProvider, | ||
| CachingIssuerProvider, | ||
| // ClientIdClientProvider, | ||
| DPoPTokenProvider, | ||
| DynamicRegistrationClientProvider, | ||
| ReactiveFetchManager, | ||
|
|
@@ -34,6 +35,7 @@ | |
| const cachingASProvider = new CachingAuthorizationServerProvider(asProvider) | ||
| const callbackUri = new URL("/callback.html", location.href).toString() | ||
| const clientProvider = new DynamicRegistrationClientProvider | ||
| // const clientProvider = new ClientIdClientProvider(new URL("./id.jsonld", location.href)) | ||
|
Contributor
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. Why do we have things commented out in a PR?
Collaborator
Author
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. This This is far from done, to be replaced down the line with unit tests, documentation comments and example code. Would you like me to remove here or are you OK for this to evolve slowly?
Contributor
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. fine for them to stay here in that case |
||
| const cachingClientProvider = new CachingClientProvider(clientProvider) | ||
|
|
||
| const dPoPTokenProvider = new DPoPTokenProvider(callbackUri, ui, cachingASProvider, cachingClientProvider) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { ClientProvider } from "./ClientProvider.js" | ||
| import * as oauth from "oauth4webapi" | ||
|
|
||
| export class ClientIdClientProvider implements ClientProvider { | ||
| constructor(private clientIdDocUri: URL) { | ||
| } | ||
|
|
||
| async getClient(_: oauth.AuthorizationServer, __: string, signal: AbortSignal): Promise<oauth.Client> { | ||
| const response = await fetch(this.clientIdDocUri, {signal}) | ||
|
Contributor
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. This looks like it will get overriden when we are monkey patching and so suffer from the issues that #21 tries to fix.
Collaborator
Author
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. Yes, relying on the global I imagine the best approach would be (as hinted in #21) for our API to take a fetch and perhaps for the manager to pass its original fetch to these methods. Even regardless of not monkey patching. |
||
| return await response.json() | ||
| } | ||
| } | ||
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.
Additional behaviours that can be added in a subsequent PR: