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

feat: add callback extras to strategy options #295

Merged
merged 1 commit into from
Oct 2, 2020
Merged

feat: add callback extras to strategy options #295

merged 1 commit into from
Oct 2, 2020

Conversation

jonalu
Copy link
Contributor

@jonalu jonalu commented Oct 2, 2020

The problem

Currently the Strategy does not support client assertions making it troublesome to use with Passport.

Proposed solution

Pass option extras: CallbackExtras to the StrategyOptions interface like so:

const strategy = new Strategy({
        client,
        params: {
            scope: 'openid profile',
        },
        extras: {
            clientAssertionPayload: {
                aud: metadata.issuer
            }
        }
    }, (tokenSet: TokenSet, done: (_err: any, _user?: any) => void) => {
        done(null, tokenSet)
    });

The function OpenIDConnectStrategy.prototype.authenticate is changed to include the client._extras as the last parameter to client.callback

Copy link
Owner

@panva panva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot that seems to have been done by whatever IDEs automated formatting. Please remove those change and only keep what's new.

.gitignore Outdated Show resolved Hide resolved
lib/passport_strategy.js Outdated Show resolved Hide resolved
test/passport/passport_strategy.test.js Outdated Show resolved Hide resolved
types/index.d.ts Outdated Show resolved Hide resolved
@jonalu
Copy link
Contributor Author

jonalu commented Oct 2, 2020

There's a lot that seems to have been done by whatever IDEs automated formatting. Please remove those change and only keep what's new.

@panva Thanks! Do you mind having another look at it?

@panva panva merged commit b77466d into panva:master Oct 2, 2020
@jonalu jonalu deleted the authenticate-client-assertion branch October 10, 2020 15:16
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants