From 025e451664a6eebb02f9b2042bdc3d56b2523ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Thu, 1 Aug 2019 23:59:23 +0200 Subject: [PATCH] Add options for IdP initiated flows to auth0-js (#37251) This commit is based on the work of abandoned #37074 PR. See problem answered here: https://community.auth0.com/t/idp-initiated-sso-auth0-js-enableidpinitiatedlogin-flag/26946 /cc @Tanver-Hasan Thanks! --- types/auth0-js/auth0-js-tests.ts | 3 ++- types/auth0-js/index.d.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 9e41f26c3d..c6ab14a972 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -57,7 +57,8 @@ webAuth.parseHash( PPoh-pITcZ8qbF5l5rMZwXiwk5efbESuqZ0IfMUcamB6jdgLwTxq-HpOT_x5q6-sO1PBHchpSo1WHeDYMlRrOFd9bh741sUuBuXdPQZ3Zb0i2sNOAC2RFB \ 1E11mZn7uNvVPGdPTg-Y5xppz30GSXoOJLbeBszfrVDCmPhpHKGGMPL1N6HV-3EEF77L34YNAi2JQ-b70nFK_dnYmmv0cYTGUxtGTHkl64UEDLi3u7bV- \ kbGky3iOOCzXKzDDY6BBKpCRTc2KlbrkO2A2PuDn27WVv1QCNEFHvJN7HxiDDzXOsaUmjrQ3sfrHhzD7S9BcCRkekRfD9g95SKD5J0Fj8NA& \ - token_type=Bearer&state=theState&refresh_token=kajshdgfkasdjhgfas&scope=foo" + token_type=Bearer&state=theState&refresh_token=kajshdgfkasdjhgfas&scope=foo", + __enableIdPInitiatedLogin: true, }, (err, authResult) => { if (err) { diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 15bc8b142f..31b97e528d 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -748,6 +748,8 @@ export interface ParseHashOptions { state?: string; nonce?: string; _idTokenVerification?: boolean; + /** indicates that you want to allow IdP-Initiated flows. See {@link https://auth0.com/docs/protocols/saml/idp-initiated-sso#lock-auth0-js} */ + __enableIdPInitiatedLogin?: boolean; } export interface RenewAuthOptions {