Skip to content

Commit 92bac80

Browse files
authored
Support for generic OAuth, OIDC and SAML providers (#575)
* Added support for generic OAuth providers * updated demo app and bumped the firebase sdk version
1 parent 82c6b30 commit 92bac80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1534
-257
lines changed

demo/public/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ function getUiConfig() {
7070
size: getRecaptchaMode()
7171
}
7272
},
73+
{
74+
provider: 'microsoft.com',
75+
providerName: 'Microsoft',
76+
buttonColor: '#2F2F2F',
77+
iconUrl: 'https://docs.microsoft.com/en-us/azure/active-directory/develop/media/howto-add-branding-in-azure-ad-apps/ms-symbollockup_mssymbol_19.png',
78+
loginHintKey: 'login_hint'
79+
},
7380
firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID
7481
],
7582
// Terms of service url.

demo/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<title>FirebaseUI Auth Demo</title>
66
<link rel="manifest" href="manifest.json">
7-
<script src="https://www.gstatic.com/firebasejs/5.5/firebase.js"></script>
7+
<script src="https://www.gstatic.com/firebasejs/5.10/firebase.js"></script>
88
<script src="config.js"></script>
99
<script src="common.js"></script>
1010
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />

demo/public/widget.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>FirebaseUI Auth Demo</title>
6-
<script src="https://www.gstatic.com/firebasejs/5.5/firebase.js"></script>
6+
<script src="https://www.gstatic.com/firebasejs/5.10/firebase.js"></script>
77
<script src="config.js"></script>
88
<script src="common.js"></script>
99
<script src="dist/firebaseui.js"></script>
@@ -54,6 +54,13 @@
5454
size: getRecaptchaMode()
5555
}
5656
},
57+
{
58+
provider: 'microsoft.com',
59+
providerName: 'Microsoft',
60+
buttonColor: '#2F2F2F',
61+
iconUrl: 'https://docs.microsoft.com/en-us/azure/active-directory/develop/media/howto-add-branding-in-azure-ad-apps/ms-symbollockup_mssymbol_19.png',
62+
loginHintKey: 'login_hint'
63+
},
5764
firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID
5865
],
5966
// Terms of service url.

javascript/ui/page/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ firebaseui.auth.ui.page.Base.prototype.startProcessing_ = function() {
229229
}
230230
self.busyIndicator_ = goog.soy.renderAsElement(
231231
firebaseui.auth.soy2.element.busyIndicator,
232-
// Pass whether a spanner is to be used instead of a progress bar.
232+
// Pass whether a spinner is to be used instead of a progress bar.
233233
{useSpinner: useSpinner}, null,
234234
self.getDomHelper());
235235
self.getElement().appendChild(self.busyIndicator_);

javascript/ui/page/emaillinksigninlinking.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ goog.require('firebaseui.auth.ui.page.Base');
2626
/**
2727
* Email link sign in linking UI component.
2828
* @param {string} email The user's email.
29-
* @param {string} providerId The provider ID of the IdP we should use for sign
30-
* in.
29+
* @param {?Object} providerConfig The provider config of the IdP we should use
30+
* for sign in.
3131
* @param {function()} onSubmitClick Callback to invoke when the submit button
3232
* is clicked.
3333
* @param {?function()=} opt_tosCallback Callback to invoke when the ToS link
@@ -40,7 +40,7 @@ goog.require('firebaseui.auth.ui.page.Base');
4040
*/
4141
firebaseui.auth.ui.page.EmailLinkSignInLinking = function(
4242
email,
43-
providerId,
43+
providerConfig,
4444
onSubmitClick,
4545
opt_tosCallback,
4646
opt_privacyPolicyCallback,
@@ -52,7 +52,7 @@ firebaseui.auth.ui.page.EmailLinkSignInLinking = function(
5252
firebaseui.auth.soy2.page.emailLinkSignInLinking,
5353
{
5454
email: email,
55-
providerId: providerId
55+
providerConfig: providerConfig
5656
},
5757
opt_domHelper,
5858
'emailLinkSignInLinking',

javascript/ui/page/emaillinksigninlinking_test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function setUp() {
5252
document.body.appendChild(root);
5353
component = new firebaseui.auth.ui.page.EmailLinkSignInLinking(
5454
55-
'facebook.com',
55+
{
56+
providerId: 'facebook.com'
57+
},
5658
goog.bind(
5759
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
5860
formTestHelper),
@@ -98,7 +100,9 @@ function testEmailLinkSignInLinking_pageEvents() {
98100
// Initialize component.
99101
component = new firebaseui.auth.ui.page.EmailLinkSignInLinking(
100102
101-
'facebook.com',
103+
{
104+
providerId: 'facebook.com'
105+
},
102106
goog.bind(
103107
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
104108
formTestHelper));

javascript/ui/page/emaillinksigninlinkingdifferentdevice.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ goog.require('firebaseui.auth.ui.page.Base');
2626

2727
/**
2828
* Email link sign in linking different device UI component.
29-
* @param {string} providerId The provider ID of the IdP we should use for sign
30-
* in.
29+
* @param {?Object} providerConfig The provider config of the IdP we should use
30+
* for sign in.
3131
* @param {function()} onContinueClick Callback to invoke when the continue
3232
* button is clicked.
3333
* @param {?function()=} opt_tosCallback Callback to invoke when the ToS link
@@ -39,7 +39,7 @@ goog.require('firebaseui.auth.ui.page.Base');
3939
* @extends {firebaseui.auth.ui.page.Base}
4040
*/
4141
firebaseui.auth.ui.page.EmailLinkSignInLinkingDifferentDevice = function(
42-
providerId,
42+
providerConfig,
4343
onContinueClick,
4444
opt_tosCallback,
4545
opt_privacyPolicyCallback,
@@ -51,7 +51,7 @@ firebaseui.auth.ui.page.EmailLinkSignInLinkingDifferentDevice = function(
5151
'constructor',
5252
firebaseui.auth.soy2.page.emailLinkSignInLinkingDifferentDevice,
5353
{
54-
providerId: providerId
54+
providerConfig: providerConfig
5555
},
5656
opt_domHelper,
5757
'emailLinkSignInLinkingDifferentDevice',

javascript/ui/page/emaillinksigninlinkingdifferentdevice_test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ function setUp() {
5353
root = goog.dom.createDom(goog.dom.TagName.DIV);
5454
document.body.appendChild(root);
5555
component = new firebaseui.auth.ui.page.EmailLinkSignInLinkingDifferentDevice(
56-
'facebook.com',
56+
{
57+
providerId: 'facebook.com'
58+
},
5759
goog.bind(
5860
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
5961
formTestHelper),
@@ -98,7 +100,9 @@ function testEmailLinkSignInLinkingDifferentDevice_pageEvents() {
98100
component.dispose();
99101
// Initialize component.
100102
component = new firebaseui.auth.ui.page.EmailLinkSignInLinkingDifferentDevice(
101-
'facebook.com',
103+
{
104+
providerId: 'facebook.com'
105+
},
102106
goog.bind(
103107
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
104108
formTestHelper));

javascript/ui/page/federatedlinking.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ goog.require('firebaseui.auth.ui.page.Base');
2828
/**
2929
* Federated account linking UI component.
3030
* @param {string} email The user's email.
31-
* @param {string} providerId The provider ID of the IdP we should use for sign
32-
* in.
31+
* @param {?Object} providerConfig The provider config of the IdP we should use
32+
* for sign in.
3333
* @param {function()} onSubmitClick Callback to invoke when the submit button
3434
* is clicked.
3535
* @param {?function()=} opt_tosCallback Callback to invoke when the ToS link
3636
* is clicked.
3737
* @param {?function()=} opt_privacyPolicyCallback Callback to invoke when the
3838
* Privacy Policy link is clicked.
39-
* @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper.
39+
* @param {?goog.dom.DomHelper=} opt_domHelper Optional DOM helper.
4040
* @constructor
4141
* @extends {firebaseui.auth.ui.page.Base}
4242
*/
4343
firebaseui.auth.ui.page.FederatedLinking = function(
4444
email,
45-
providerId,
45+
providerConfig,
4646
onSubmitClick,
4747
opt_tosCallback,
4848
opt_privacyPolicyCallback,
@@ -53,7 +53,7 @@ firebaseui.auth.ui.page.FederatedLinking = function(
5353
firebaseui.auth.soy2.page.federatedLinking,
5454
{
5555
email: email,
56-
providerId: providerId
56+
providerConfig: providerConfig
5757
},
5858
opt_domHelper,
5959
'federatedLinking',

javascript/ui/page/federatedlinking_test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ function setUp() {
5353
document.body.appendChild(root);
5454
component = new firebaseui.auth.ui.page.FederatedLinking(
5555
56-
'google.com',
56+
{
57+
providerId: 'google.com'
58+
},
5759
goog.bind(
5860
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
5961
formTestHelper),
@@ -102,7 +104,9 @@ function testFederatedLinking_pageEvents() {
102104
// Initialize component.
103105
component = new firebaseui.auth.ui.page.FederatedLinking(
104106
105-
'google.com',
107+
{
108+
providerId: 'google.com'
109+
},
106110
goog.bind(
107111
firebaseui.auth.ui.element.FormTestHelper.prototype.onSubmit,
108112
formTestHelper));

0 commit comments

Comments
 (0)