This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iter := client.TenantManager.Tenants(ctx, "") | |
| for { | |
| tenant, err := iter.Next() | |
| if err == iterator.Done { | |
| break | |
| } | |
| if err != nil { | |
| log.Fatalf("error listing tenants: %v\n", err) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| newConfig := (&auth.SAMLProviderConfigToCreate{}). | |
| DisplayName("SAML provider for ABC Auto"). | |
| Enabled(true). | |
| ID("saml.provider"). | |
| IDPEntityID("IDP_ENTITY_ID"). | |
| SSOURL("https://abcauto.com/saml/sso/1234/"). | |
| X509Certificates([]string{ | |
| "-----BEGIN CERTIFICATE-----\nCERT1...\n-----END CERTIFICATE-----", | |
| "-----BEGIN CERTIFICATE-----\nCERT2...\n-----END CERTIFICATE-----", | |
| }). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a new auth.TenantClient instance. | |
| tenantClient, err := client.TenantManager.AuthForTenant(tenantID) | |
| if err != nil { | |
| log.Fatalf("error initializing tenant client: %v\n", err) | |
| } | |
| params := (&auth.UserToCreate{}). | |
| Email("[email protected]"). | |
| EmailVerified(true). | |
| PhoneNumber("+15555550100"). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "context" | |
| "log" | |
| firebase "firebase.google.com/go" | |
| "firebase.google.com/go/auth" | |
| ) | |
| // Initialize the Admin SDK | |
| ctx := context.Background() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using FirebaseAdmin.Auth; | |
| [Route("login")] | |
| public class LoginController : ControllerBase | |
| { | |
| private readonly UserStore userStore = new UserStore(); | |
| [HttpPost] | |
| public async Task<ActionResult> Login([FromBody] LoginRequest request) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using FirebaseAdmin; | |
| public class Startup | |
| { | |
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| // Initialize the Firebase Admin SDK | |
| FirebaseApp.Create(); | |
| services.AddMvc(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as admin from 'firebase-admin'; | |
| import * as functions from 'firebase-functions'; | |
| import * as sendgrid from '@sendgrid/mail'; | |
| admin.initializeApp(); | |
| export const sendEmailVerification = functions.auth.user().onCreate( | |
| async (user: admin.auth.UserRecord, context: functions.EventContext) => { | |
| const email = user.email; | |
| const link = await admin.auth().generateEmailVerificationLink(email, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const user = firebase.auth().currentUser; | |
| user.sendEmailVerification().then(function() { | |
| displayHomePage(); | |
| }).catch(function(error) { | |
| displayError(error); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getMessages(count) { | |
| const messages = []; | |
| for (let i = 0; i < count; i++) { | |
| messages.push({ | |
| topic: `test-topic-${i % 10}`, | |
| }); | |
| } | |
| return messages; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const messages = []; | |
| messages.push({ | |
| notification: { | |
| title: 'Good morning Alice', | |
| body: 'The weather in your area is nice and sunny today.', | |
| }, | |
| token: token1, | |
| }); | |
| messages.push({ | |
| notification: { |