问题标签 [satellizer]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
494 浏览

angularjs - 如何删除 API 错误 401 上的令牌?

$http如果任何调用导致 401 错误,从服务器检测错误并删除令牌的最简单方法是什么?例如,如果会话在用户未使用应用程序时到期,则当他们返回 Web 应用程序时,令牌不再有效。如果我在 API 调用期间发回 401 错误,我需要注意这一点并让用户重新登录。

目前,在 Chrome 开发者工具中,我可以看到 401 错误,但 Satellizer 并没有删除令牌(以为是一次删除)。

我尝试创建一个 httpInterceptor,但收到循环依赖错误

0 投票
0 回答
116 浏览

ionic-framework - 使用带有离子的卫星器时出错

.controller('LoginCtrl', function($scope, $location, $stateParams, $ionicHistory, $http, $state, $auth,$rootScope) {

}); 我收到此错误错误:[$injector:unpr] Unknown provider: $authProvider <- $auth <- LoginCtrl当我在函数中添加 $auth 时。

0 投票
1 回答
181 浏览

angularjs - 卫星发射器错误

当我调用登录功能时,我收到此错误

POST http://localhost:8100/auth/login 404(未找到)

卫星发射器有问题吗?

0 投票
1 回答
730 浏览

angularjs - OAuth2 with Satellizer and a generic OAuth2 provider

I'm having much trouble getting OAuth2 to work with a generic OAuth2 provider. Here's the situation.

A service provides an OAuth2 authentication method to where I want to authorize with. I've created an AngularJS app that has the following configuration for satellizer:

The baseUrl points to my node server that should handle the middleware part.

I've also the following code that triggers the authentication part.

So far this all seems to work great and looks very similar to what is documented by Satellizer! Now once I start the angular app and start the authentication I see requests coming by that target my Node service.

Next I've my node.js service that hooks to the 'user/authorize/token' URL. Here's the code:

and:

Here's where it all seems to go wrong. First I seem to get an OPTIONS request. I've not really an idea what to do with it as I can't seem to find anything in the documentation about an OPTIONS request. I thought it would might contain the 'Authorization' header but that doesn't seem the case so I close the connection with a res.end();

I also inspected the request in Chrome but I can't seem to find a header that has this exact name.

Next I get a POST request. This does seem to contain some things, hooray! I get the following object:

This looks to me like the authorization code that I should have to decode. That's what you see me trying as well in the code above. Unfortunately this seems to throw me an error

Error: Not enough or too many segments

This tells me I'm doing probably something wrong, and I got stuck.

I do have some PHP code that seems to work for someone else but I don't fully understand and can't really relate the code to my code since PHP is not my speciality and node.js/JavaScript not his. So here goes the PHP code:

Hopefully someone can help me out! Thanks in advance.

0 投票
0 回答
159 浏览

php - 当我使用带有 laravel 的 satellizer 登录 facebook 时,个人资料没有显示

我知道我的问题并不具体,但我想讨论我的问题。

我想用 laravel 进行 Angular 社交登录,所以我使用的是 satelizer 社交登录。登录和注销工作正常,但是当我点击个人资料时,它显示错误。我不知道问题出在哪里。如果有人有解决方案,请帮助我。错误是在此处输入图像描述

我的代码是:-

角度路线

配置文件控制器

账户服务

Laravel 路由 // API 路由。

Laravel 控制器

0 投票
0 回答
172 浏览

angularjs - satellizer Angular JS中的跨域登录

我在前端使用Satellizer进行 JWT 身份验证。我将服务器端Node js部署在Cloud9上,客户端在 localhost 上运行。现在通过 cors 模块在服务器端启用了CORS ,并且工作正常。

相同的客户端使用 Restangular 作为服务。

现在这工作正常。通过 Restangular 的每个请求在节点中都是成功的。但我无法登录或注册。请求无法访问服务器端。控制台中也没有错误。我已经尝试过 这个问题 和许多其他问题。但是不能让它工作。

那么我怎样才能让卫星器为跨域工作????

编辑:另外在 satellizer 中添加此代码。

我在控制台中得到了带有 null 的错误块,并且还使用 status:-1 调用了 catch 块。

在此处输入图像描述

0 投票
1 回答
452 浏览

angularjs - 卫星发射器和护照集成

我目前有一个运行 PassportJS 的 ExpressJS 应用程序。我使用 Passport 向 GitHub 进行身份验证。这些是现有的端点。

这将创建授权 url 并重定向到该 url:

这对获取访问令牌、用户对象和 json Web 令牌具有神奇的作用:

如您所见,我只有/需要 2 个端点。authentication/api 位于,http://localhost:8080/前端位于http://localhost:3000/

所以我的问题是:Satellizer 使用这些现有端点的设置是什么?我应该使用$authProvider.github()还是自定义$authProvider.oauth()提供程序对象?

0 投票
0 回答
110 浏览

angularjs - 卫星和雅虎 OAuth1.0

有没有人成功使用 Satellizer ( https://github.com/sahat/satellizer ) 使用 Oauth1.0 连接到 Yahoo API?我可以让 Oauth2.0 工作,但我必须使用 1.0 才能访问 Fantasy Sports API。在我的角度模块中,我声明了 oauth1.0 设置。

因为我需要先获取一个request_token,所以不知道怎么设置。

0 投票
0 回答
115 浏览

javascript - 使用卫星自动登录

我在登录控制器中实现了卫星化。但是,自动登录呢?什么是最佳实践?

对 auth 的调用现在在 LoginCtrl 中:

当用户在另一个页面上时,如果令牌已过期,他将无法访问需要身份验证的页面。我不想让他再次登录。因此,在每个其他控制器中,如果对某些受保护资源的请求失败,我的想法是自动登录他。所以我把 auth.login 放在所有这些控制器中。这看起来是一个糟糕的选择。

我应该怎么办?创建服务?登录和自动登录?这是最佳实践吗?

0 投票
0 回答
259 浏览

angularjs - Angular(Satellizer)和 Facebook 登录的 CORS 问题

这是我的第一个 StackOverflow 输入,所以请温柔:p

我正在使用 MEAN 堆栈做一个 web 应用程序,但我遇到了一个我似乎无法解决的问题。尝试了我在网上找到的几种解决方案,但似乎没有任何效果。我有这个 Node/Express 后端,它与 facebook 联系,具有:

然后收到来自 facebook 的回调:

我可以在我的 console.log 中看到我得到的数据是我所期望的!到目前为止一切顺利.. 问题是,当我点击我的 facebook 登录按钮时,它会调用我的 satellizer facebook 登录:

.. 我在我的 chrome 控制台中收到这条消息:

我想我已经监督了一些事情,但我不知道是什么.. 当我单击它尝试重定向到的链接时,我在终端的控制台中获得了我的信息打印。但我不能被重定向,因为它不允许,显然..

有谁知道解决方案可能是什么?我试图把它放到我的 server.app 中:

正如我希望的那样,我可以绕过跨源政策,但它也没有奏效。

有什么建议么?:-)

此致!