GithubHelp home page GithubHelp logo

nasrulgunawan / exfirebaseauth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nickforall/exfirebaseauth

0.0 0.0 0.0 98 KB

๐Ÿ”ฅโš—๏ธ Handling and testing Firebase Auth tokens in Elixir

Home Page: https://hexdocs.pm/ex_firebase_auth

License: MIT License

Elixir 100.00%

exfirebaseauth's Introduction

ExFirebaseAuth ๐Ÿ”ฅ

ExFirebaseAuth is a library that handles ID tokens from Firebase, which is useful for using Firebase's auth solution because Firebase does not have an Elixir SDK for auth themselves. ExFirebaseAuth also comes with some testing utilities that mock and generate ID tokens for your integration tests.

More information on how ID tokens work in Firebase Auth

This library

  • Keeps track of google's public keys used for signing ID tokens
  • Verifies ID tokens
  • Veries whether the issuer matches your firebase project

This library does not

  • Aim to implement Firebase user admin SDK endpoints

Installation

If available in Hex, the package can be installed by adding ex_firebase_auth to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_firebase_auth, "~> 0.5.1"}
  ]
end

Usage

Add the Firebase auth issuer name for your project to your config.exs. This is required to make sure only your project's firebase tokens are accepted.

config :ex_firebase_auth, :issuer, "https://securetoken.google.com/project-123abc"

or if you'd like to define a different issuer per app

config :your_app, :ex_firebase_auth, 
  issuer: "https://securetoken.google.com/project-123abc"

Verifying a token

ExFirebaseAuth.Token.verify_token("Some token string")
iex> {:ok, "userid", %{}}

or

ExFirebaseAuth.Token.verify_token("Some token string", :your_app)
iex> {:ok, "userid", %{}}

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_firebase_auth.

exfirebaseauth's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.