Is it possible to enable Firebase Auth in ASP.NET Core MVC?

I am working on creating an Ionic mobile application and I plan to use Firebase databases and real-time databases. I'm trying to figure out if it is possible to include Firebase auth in server-side processing on the MVC MVC site associated with it. This would allow me to use some “static” server pages to process subscriptions, payments, etc., but at the same time use the same user-defined Firebase scheme as a mobile application.

I know that Firebase is tied to javascript clients, and I found this request authentication example that includes the Authorization header in the API inside the asp.net core, so you can check the firebase token in the asp.net pipeline. However, this assumes that the javascript client fulfills all the requests, and I would like to use the token stored in some cookies that I can provide to the browser instead. This will allow me to handle authentication on non javascript static pages in my application.

I think there must be some way to initiate authentication against firebase and redirect the response to MVC action. Then you could presumably set the cookie "indentity" to asp.net, which will be stored on the update page. Or I just don’t understand how it works?

Comment on a possible duplicate of Firebase authentication asp.net core :

This is not a hoax, in my opinion, because this question is about checking the JWT token provided by the client (presumably javascript). I believe that the link I included initially demonstrates a way to solve this problem.

+5
source share

Source: https://habr.com/ru/post/1264019/


All Articles