How to create Firebase Authentication claims?

前端 未结 1 352
既然无缘
既然无缘 2021-01-27 08:39

I am developing an Android app that needs to authenticate with a server application. The server application is a Spring Boot app that uses Spring Security. The server app uses a

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-27 09:31

    Custom claims for Firebase Authentication can currently only be created through the Firebase Admin SDKs. From the documentation on creating custom claims:

    // Set admin privilege on the user corresponding to uid.
    admin.auth().setCustomUserClaims(uid, {admin: true}).then(() => {
      // The new custom claims will propagate to the user's ID token the
      // next time a new one is issued.
    });
    

    It's not a bad idea to allow creating claims from the console too, so I'd recommend you file a feature request.

    0 讨论(0)
提交回复
热议问题