Giter Club home page Giter Club logo

firebase-auth's People

Contributors

a-pechenyi avatar armyofgnomes avatar trchopan avatar wickwirew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

firebase-auth's Issues

Public keys don't update

When the app runs for an extended period, the public keys fail to update, resulting in a VerificationError::NotfoundMatchKid. This issue seems to occur specifically with the axum integration.

The root cause lies in the FirebaseAuthState. During its cloning process, it also clones FirebaseAuth. However, when one of these clones is dropped, the Drop handler of FirebaseAuth cancels the future spawned in start_key_update.

I am willing to address this issue, but it will necessitate changes that are not backward compatible. Specifically, I propose modifying FirebaseAuthState to contain Arc<FirebaseAuth> instead of FirebaseAuth, and removing the FromRef<FirebaseAuthState> for FirebaseAuth implementation.

Additionally, another issue arises within the start_key_update function. Based on the logs, it appears that there should be a loop statement somewhere, but it's missing. Upon reviewing a commit from 8 months ago, it seems that the loop was accidentally removed. It was present before.

Extend FirebaseAuthState to allow fakes

Hi!

I am quite new to Rust so not sure if I am approaching this the wrong way.

Would it be possible to use a trait instead of a struct in FirebaseAuthState so that I can supply my own implementation of the trait in testing? For example if I want to integration-test and control which tokens passes validation or not.

Support other claims info

hello.
I am using firebase and hasura together.
I'm trying to create an API server with rust, and I found the firebase_auth rust.
However, I cannot get it from claims as shown below.
The reason is that the struct FirebaseUser struct is fixed.

https://github.com/trchopan/firebase-auth/blob/main/firebase-auth/src/structs.rs#L30C1-L30C26
To solve the problem, claims need to be used flexibly. What method should I use?

{
    'https://hasura.io/jwt/claims': {
        'x-hasura-default-role': 'user',
        'x-hasura-allowed-roles': ['user'],
        'x-hasura-user-id': user_id
    },
    'iss': 'https://securetoekn.google.com/example-app',
    'aud': 'example-app',
    'auth_time: 0000000,
    'user_id: firebase_auth_user_id,
    ....
};

Support Firebase Anonymous Sign-In

JWT for anonymous sign-in looks like this:

{
  "provider_id": "anonymous",
  "iss": "https://securetoken.google.com/example-app-a1234",
  "aud": "example-app-a1234",
  "auth_time": 1688463060,
  "user_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sub": "aaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "iat": 1689243393,
  "exp": 1689246993,
  "firebase": {
    "identities": {},
    "sign_in_provider": "anonymous"
  }
}

changes:

  • Add an optional provider_id string
  • Make email optional
  • Make email_verified optional

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.