Browse Source

Update README.md

issue-90
8legd 8 years ago
parent
commit
58c14a1b78
  1. 10
      username-password-auth/README.md

10
username-password-auth/README.md

@ -1,6 +1,6 @@
# Username/password sign in with Firebase
This sample shows how to authenticate with a username/password Sign-In on Firebase. In this sample we use a basic authentication request with the supplied credentials and if succesful create a Firebase Custom Token.
This sample shows how to authenticate with a username/password to Sign-In with Firebase. In this sample we use a basic authentication request with the supplied credentials and if succesful create a Firebase Custom Token.
NOTE: [Firebase Authentication](https://firebase.google.com/docs/auth/web/password-auth) can be used for email address/password sign in. This sample specifically addresses the case in which an email address is not used as the unique identifier for a user.
@ -8,7 +8,7 @@ NOTE: [Firebase Authentication](https://firebase.google.com/docs/auth/web/passwo
Create and setup the Firebase project:
1. Create a Firebase project using the [Firebase Developer Console](https://console.firebase.google.com).
1. Enable Billing on your Firebase the project by switching to the **Blaze** plan, this is currently needed to be able to perform HTTP requests to external services from a Cloud Function.
1. Enable Billing on your Firebase project by switching to the **Blaze** plan, this is currently needed to be able to perform HTTP requests to external services from a Cloud Function.
1. Copy the Web initialisation snippet from **Firebase Console > Overview > Add Firebase to your web app** and paste it in `public/index.html` in lieu of the placeholder (where the `TODO(DEVELOPER)` is located).
Create and provide a Service Account's credentials:
@ -28,8 +28,10 @@ Enter credentials and click on the **Sign in** button. At this point you are aut
## Workflow and design
When clicking the **Sign in** button the `auth` Function authenticates the username/password then Mints and returns a Firebase Custom Auth token (which is why we need Service Accounts Credentials).
When clicking the **Sign in** button the `auth` Cloud Function authenticates the username/password then Mints and returns a Firebase Custom Auth token (which is why we need Service Accounts Credentials).
The [httpbin](https://httpbin.org) request & response service is used for the basic authentication request.
The [httpbin](https://httpbin.org) request & response service is used for the basic authentication request in this example.
The main page will detect the sign-in through the Firebase Auth State observer and display the signed-In user information.
NOTE: In production you'll need to update the placeholder `authenticate` function in `./functions/index.js` so that it authenticates with your own credentials system.

Loading…
Cancel
Save