-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Allow adding custom loopback client in acquireTokenInteractive #5578
Conversation
Codecov Report
*This pull request uses carry forward flags. Click here to find out more.
|
Reminder: The next release is scheduled for next week and this PR appears to be stale :( If changes have been requested please address feedback. |
import { AuthorizationUrlRequest } from "./AuthorizationUrlRequest"; | ||
|
||
export type InteractiveRequest = Pick<AuthorizationUrlRequest, "authority"|"correlationId"|"claims"|"azureCloudOptions"|"account"|"extraQueryParameters"|"tokenQueryParameters"|"extraScopesToConsent"|"loginHint"|"prompt"> & { | ||
openBrowser: (url: string) => Promise<void>; | ||
scopes?: Array<string>; | ||
successTemplate?: string; | ||
errorTemplate?: string; | ||
customLoopbackClient?: ILoopbackClient |
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.
Let's just call this loopbackClient
customLoopbackClient?: ILoopbackClient | |
loopbackClient?: ILoopbackClient |
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.
done!
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.
Looks good, 2 nits and any docs or samples we can add to help illustrate usage?
Co-authored-by: Thomas Norling <thomas.l.norling@gmail.com>
Co-authored-by: Thomas Norling <thomas.l.norling@gmail.com>
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.
Looks good, thanks!
*/ | ||
async acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult> { | ||
public async acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult> { |
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.
nit: not needed
public async acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult> { | |
async acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult> { |
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.
true, but given the rest of acquireToken*
implementations has the modifier explicitly, shouldn't we keep this for consistency?
done and done! |
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.
Looks good. Do we have a docs (and .md file) defining why someone would need a loop back server? If yes, please link here, if not, can we add it? Can be handled as a separate PR.
Thanks! Added comments for API documentation and also to an Electron sample for usage. Need to update/re-organize some of our .md docs for API usage -so probably best to tackle this separately in another PR |
🎉 Handy links: |
This PR adds a loopback client interface to
InteractiveRequest
for devs who would like to run their own server for listening the authZ code response inacquireTokenInteractive
API.