Coder Social home page Coder Social logo

rotolonico / firebase-auth-with-google-rest-api Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 11.0 18.33 MB

An example of a implementation with REST APIs of Firebase Authentication with Google provider (based around this tutorial: https://youtu.be/AWp9RdxTJco)

C# 100.00%

firebase-auth-with-google-rest-api's People

Contributors

rotolonico avatar

Stargazers

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

Watchers

 avatar  avatar

firebase-auth-with-google-rest-api's Issues

i'm getting 403 error using the ip loopback

it says "Success, you can return to the app now!" but this pops up
but the part in

 var payLoad =
            $"{{\"postBody\":\"id_token={token}&providerId={providerId}\",\"requestUri\":\"http://localhost\",\"returnIdpCredential\":true,\"returnSecureToken\":true}}";
        RestClient.Post($"https://identitytoolkit.googleapis.com/v1/accounts:signInWithIdp?key={ApiKey}", payLoad).Then(
            response =>
            {
                // You now have the userId (localId) and the idToken of the user!
                Debug.Log(response.Text);
           }).Catch(Debug.Log);    
    }

RequestException: HTTP/1.1 403 Forbidden
UnityEngine.Debug:LogError (object)
FirebaseAuthHandler/<>c:<SingInWithToken>b__1_1 (System.Exception) (at Assets/Scripts/FirebaseAuthHandler.cs:27)
RSG.Promise/<>c__DisplayClass44_0:<Catch>b__1 (System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise_NonGeneric.cs:660)
RSG.Promise:InvokeRejectHandler (System.Action`1<System.Exception>,RSG.IRejectable,System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise_NonGeneric.cs:437)
RSG.Promise/<>c__DisplayClass34_0:<InvokeRejectHandlers>b__0 (RSG.RejectHandler) (at Assets/RestClient/Packages/RSG.Promise/Promise_NonGeneric.cs:500)
RSG.Promises.EnumerableExt:Each<RSG.RejectHandler> (System.Collections.Generic.IEnumerable`1<RSG.RejectHandler>,System.Action`1<RSG.RejectHandler>) (at Assets/RestClient/Packages/RSG.Promise/EnumerableExt.cs:15)
RSG.Promise:InvokeRejectHandlers (System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise_NonGeneric.cs:500)
RSG.Promise:Reject (System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise_NonGeneric.cs:554)
RSG.Promise`1/<>c__DisplayClass44_0<Proyecto26.ResponseHelper>:<Then>b__1 (System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise.cs:767)
RSG.Promise`1<Proyecto26.ResponseHelper>:InvokeHandler<System.Exception> (System.Action`1<System.Exception>,RSG.IRejectable,System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise.cs:353)
RSG.Promise`1/<>c__DisplayClass24_0<Proyecto26.ResponseHelper>:<InvokeRejectHandlers>b__0 (RSG.RejectHandler) (at Assets/RestClient/Packages/RSG.Promise/Promise.cs:381)
RSG.Promises.EnumerableExt:Each<RSG.RejectHandler> (System.Collections.Generic.IEnumerable`1<RSG.RejectHandler>,System.Action`1<RSG.RejectHandler>) (at Assets/RestClient/Packages/RSG.Promise/EnumerableExt.cs:15)
RSG.Promise`1<Proyecto26.ResponseHelper>:InvokeRejectHandlers (System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise.cs:381)
RSG.Promise`1<Proyecto26.ResponseHelper>:Reject (System.Exception) (at Assets/RestClient/Packages/RSG.Promise/Promise.cs:437)
Proyecto26.RestClient:Promisify<Proyecto26.ResponseHelper> (RSG.Promise`1<Proyecto26.ResponseHelper>,Proyecto26.RequestException,Proyecto26.ResponseHelper) (at Assets/RestClient/Packages/Proyecto26.RestClient/RestClientPromise.cs:341)
Proyecto26.HttpBase/<CreateRequestAndRetry>d__0:MoveNext () (at Assets/RestClient/Packages/Proyecto26.RestClient/Helpers/HttpBase.cs:40)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

Error 400

I add on FirebaseAuthHandler class my ApiKey and
on GoogleAuthenticator class ClientId, ClientSecret
but when i press get google code i take

image

Proyecto26.RequestException: HTTP/1.1 400 Bad Request

I tried the both methods but while playing in editor and pressing the sing in with google button it redirect me to browser and asking which id to sign in also on selecting one successfully signing in but if i go back to the editor in debug it prints this exception plz help me buddy.
Proyecto26.RequestException: HTTP/1.1 400 Bad Request

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.