我正在试验来自www.auth0.com和AngularJS的auth0-lock。我可以像SDK中那样传递一些参数:https://auth0.com/docs/libraries/lock/customization#connections-array-
auth.signin({
disableSignupAction: true,
socialBigButtons: true,
//these lines don't work
//no changes (username, password appears)
//connection: 'windows-live'
//this line returns 'No valid connection found'
//connections: 'windows-live'
//this line returns 'No valid connection found'
//connections: ['windows-live']
//this line doesn't change anything
//connection: ['windows-live']
}但是我不能传递连接(SDK的非angular版本)
lock.show({
connections: ['twitter', 'facebook', 'linkedin']
});参数连接或连接都不起作用。
我遇到的问题是,如果我不指定连接,用户名和密码就会出现。根据SDK,我需要硬编码它,以隐藏这些字段。由于SDK是为JS而不是AngularJS编写的,我似乎在传递数组或参数时遇到了问题。有什么想法吗?
发布于 2016-01-27 11:01:34
您想要发送一个带有connections参数的数组:
connections: ['windows-live']而不是像您所拥有的那样使用字符串:
connections: 'windows-live'发布于 2016-02-19 07:25:12
您是否在仪表板中启用了社交功能?

发布于 2016-03-15 15:38:12
在这一点上,文档似乎是一般的。如果您使用//cdn.auth0.com/js/lock-8.js,它应该可以开箱即用,如前面的响应所示,并遵循示例https://github.com/auth0/auth0-angular/tree/master/examples。
我在connections:& connection中挣扎了几个小时,试图让一些自定义连接正常工作。
作为基础,您可以启用Auth0社交提供者中的各种提供者,确保它们切换为绿色。从尽可能简单的开始,并从那里扩展。
auth.signin({
scope: 'openid name email'index.html
<script type="text/javascript" src="//cdn.auth0.com/js/lock-8.js"></script>
<!--script src="//cdn.auth0.com/w2/auth0-6.7.js"></script-->
<script type="text/javascript" src="https://cdn.auth0.com/w2/auth0-angular-4.js"></script>
<script src="./lib/a0-angular-storage/dist/angular-storage.js"></script>
<script src="./lib/angular-jwt/dist/angular-jwt.js"></script>登录ctrl
.controller('LoginCtrl',
function onLoginSuccess(profile, token) {
console.log("login ok");
}
function onLoginFailed() {
console.log("failed login");
}
auth.signin({
scope: 'openid name email'
}, onLoginSuccess, onLoginFailed);
}配置块
.config(function($stateProvider, $urlRouterProvider, authProvider,
jwtInterceptorProvider, $httpProvider) {
authProvider.init({
domain: '',
clientID: '',
loginState: 'login',
loginUrl: true
});
authProvider.on('loginSuccess', function($location, profilePromise, idToken, store) {
profilePromise.then(function(profile) {
console.log(JSON.stringify(profile));https://stackoverflow.com/questions/35025736
复制相似问题