Firebase Google Simple Login displays redirect_uri_mismatch

Firebase Google Simple Login displays message

"Error: redirect_uri_mismatch

Application: AppLogin

You can write to the developer of this application at: zhangjiweikiwi@gmail.com

The redirect URI in the request: https://auth.firebase.com/auth/google/callback does not match the registered redirect URI. "

I tried to fill in both of the following redirect URIs in google client id

    https://auth.firebase.com/v2/saas/auth/google/callback/    ('saas' is my firebase name)
    https://auth.firebase.com/auth/google/callback

      

Origin of Javascript

    https://auth.firebase.com

      

This is the code:

http://plnkr.co/edit/2Zfe8A?p=preview

enter code here

<head>

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js"></script>
        <script src="https://cdn.firebase.com/js/client/2.1.0/firebase.js"></script>
<script src="https://cdn.firebase.com/js/simple-login/1.6.4/firebase-simple-login.js"></script>    <script src="https://cdn.firebase.com/libs/angularfire/0.8.0/angularfire.min.js"></script>

    <!-- Latest compiled and minified Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">

   <!-- <script src="app.js"></script> -->

   <script>
      //Here is all the code that talks to Firebase
       var app = angular.module("sampleApp", ["firebase"]);



      // let create a re-usable factory that generates the $firebaseSimpleLogin instance
      app.factory("simpleLogin", ["$firebaseSimpleLogin", function($firebaseSimpleLogin) {
        var ref = new Firebase("https://saas.firebaseio.com/");
        return $firebaseSimpleLogin(ref);
      }]);

      // and use it in our controller
      app.controller("loginCtrl", ["$scope", "simpleLogin", function($scope, simpleLogin) {
        $scope.auth = simpleLogin;
      }]);



   </script>

  </head>
  <body>
    This simple app is based on Angularjs and Firebase. <br>
    <hr>
    <div ng-controller="loginCtrl">
      <div ng-show="auth.user">
        <p>Hello, {{auth.user.displayName}}</p>
        <button ng-click="auth.$logout()">Logout</button>
      </div>
      <div ng-hide="auth.user">
        <p>Welcome, please log in.</p>
        <button ng-click="auth.$login('google')">Login</button>
      </div>
    </div>

    <br>




  </body>
</html>

      

+3


source to share





All Articles