【问题标题】:Google oauth satellizer 404 ErrorGoogle oauth satellizer 404 错误
【发布时间】:2015-12-22 19:55:51
【问题描述】:

这是我的代码。我正在使用authenticate('google')。单击允许按钮后,我得到 error 404。 我正在使用 satellizer.js 进行谷歌身份验证。

如果您理解此错误,请帮助我。

浏览器出错 发布http://localhost:8080/auth/google 404(未找到)

Object {data: "Cannot POST /auth/google↵", status: 404, config: Object, statusText: "Not Found"}

内部控制器

 $scope.authenticate = function (provider) {
            $auth.link(provider)
                .then(function(response) {
                    // You have successfully linked an account.
                    console.log(response);
                })
                .catch(function(response) {
                    // Handle errors here.
                    console.log('----------error--------')
                    console.log(response);
                });
        };

我在 app.js 中的代码

$authProvider.google({
            clientId: 'xxxxxxxxxx2op4madn.apps.googleusercontent.com'
        });

        $authProvider.google({
            url: '/auth/google',
            authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
            redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
            requiredUrlParams: ['scope'],
            optionalUrlParams: ['display'],
            scope: ['profile', 'email'],
            scopePrefix: 'openid',
            scopeDelimiter: ' ',
            display: 'popup',
            type: '2.0',
            popupOptions: {width: 452, height: 633}
        });

【问题讨论】:

    标签: javascript angularjs oauth satellizer


    【解决方案1】:

    我遇到的问题实际上是在该 URL 上找到一个发布请求,您可以在 server.js 文件中添加一些配置,然后按照这个给定的 GIT-URL。

    github satellizer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-02
      • 2018-10-28
      • 1970-01-01
      • 2019-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-06
      • 2012-07-14
      相关资源
      最近更新 更多