-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathwidget.html
88 lines (87 loc) · 3.17 KB
/
widget.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>FirebaseUI Auth Demo</title>
<script src="https://www.gstatic.com/firebasejs/10.0.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.0.0/firebase-auth-compat.js"></script>
<script src="config.js"></script>
<script src="common.js"></script>
<script src="dist/firebaseui.js"></script>
<link type="text/css" rel="stylesheet" href="dist/firebaseui.css" />
<style>
body {
margin: 0;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
// FirebaseUI config.
var uiConfig = {
// Url to redirect to after a successful sign-in.
'signInSuccessUrl': '/',
'callbacks': {
'signInSuccess': function(user, credential, redirectUrl) {
if (window.opener) {
// The widget has been opened in a popup, so close the window
// and return false to not redirect the opener.
window.close();
return false;
} else {
// The widget has been used in redirect mode, so we redirect to the signInSuccessUrl.
return true;
}
}
},
'signInOptions': [
// TODO(developer): Remove the providers you don't need for your app.
{
provider: firebase.auth.GoogleAuthProvider.PROVIDER_ID,
// Required to enable ID token credentials for this provider.
clientId: CLIENT_ID
},
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.TwitterAuthProvider.PROVIDER_ID,
firebase.auth.GithubAuthProvider.PROVIDER_ID,
{
provider: firebase.auth.EmailAuthProvider.PROVIDER_ID,
signInMethod: getEmailSignInMethod(),
disableSignUp: {
status: getDisableSignUpStatus()
}
},
{
provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
recaptchaParameters: {
size: getRecaptchaMode()
}
},
{
provider: 'microsoft.com',
loginHintKey: 'login_hint'
},
{
provider: 'apple.com',
},
firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID
],
// Terms of service url.
'tosUrl': 'https://www.google.com',
'credentialHelper': CLIENT_ID && CLIENT_ID != 'YOUR_OAUTH_CLIENT_ID' ?
firebaseui.auth.CredentialHelper.GOOGLE_YOLO :
firebaseui.auth.CredentialHelper.NONE,
'adminRestrictedOperation': {
status: getAdminRestrictedOperationStatus()
}
};
// Initialize the FirebaseUI Widget using Firebase.
var ui = new firebaseui.auth.AuthUI(firebase.auth());
// The start method will wait until the DOM is loaded to include the FirebaseUI sign-in widget
// within the element corresponding to the selector specified.
ui.start('#firebaseui-auth-container', uiConfig);
</script>
</head>
<body>
<div id="firebaseui-auth-container"></div>
</body>
</html>