标签: stormpath

用Stormpath登录LinkedIn

我可以使用LinkedIn SDK快速获取我的LinkedIn帐户的访问令牌.如何使用Stormpath对此登录进行身份验证?

[更新]

让APIURL =" https://api.stormpath.com/v1/applications/ LI_APPLICATION_ID/accounts"

func sendRequestWithJSON(accessToken:String)
{
    let json = [ "providerData" : ["providerId": "linkedin", "accessToken": accessToken] ]


    do {

        let jsonData = try NSJSONSerialization.dataWithJSONObject(json, options: .PrettyPrinted)

        let username = STORMPATH_API_KEY_ID
        let password = STORMPATH_API_KEY_SECRET
        let loginString = NSString(format: "%@:%@", username, password)
        let loginData: NSData = loginString.dataUsingEncoding(NSUTF8StringEncoding)!
        let base64LoginString = loginData.base64EncodedDataWithOptions(NSDataBase64EncodingOptions.Encoding64CharacterLineLength)

        // create post request
        let url = NSURL(string: APIURL)!
        let request = NSMutableURLRequest(URL: url)
        request.HTTPMethod = "POST"


        // insert json data to the request
        request.setValue("Basic …
Run Code Online (Sandbox Code Playgroud)

swift stormpath swift2

3
推荐指数
1
解决办法
214
查看次数

通过stormpath进行Apigee身份验证.这可行吗?

目前,我的Web应用程序的所有用户都通过stormpath进行身份验证.从现在开始,该Web应用程序将需要使用Apigee上托管的rest api.在这里开始我的怀疑.Apigee通过oauth2.0授予对API的访问权限.那很棒.但是,我想知道我是否能够在Stormpath服务中保留当前的webapp身份验证.我不是Oauth的专家.因此,我不确定在Stormpath中进行身份验证是否可行,然后在Apigee中请求一个AccessToken.WebApplication将具有客户端凭据以请求访问令牌.直截了当:用户是否可以在第三方服务中进行身份验证,并且仍然可以获得Apigee托管的Rest API的Oauth访问令牌?

非常感谢.

authentication authorization oauth-2.0 apigee stormpath

2
推荐指数
1
解决办法
375
查看次数

调用和保存用户帐户自定义数据

我正在使用node.sdk,stormpath,express.js和passport.js为我的新网站建立一个用户帐户系统.所以我建立了一个自定义数据槽的帐户.我想知道如何在他们登录时将新数据发布到此自定义数据槽并在登录时检索它.我是新手使用节点而我不知道在哪里放置我的代码或如何访问他们登录后的'用户'帐户信息.从我可以告诉passport.js正在处理身份验证,所以我可能无法看到用户的电子邮件在stormpath api上搜索他们的用户帐户网址...也许我'我在这里遗失了什么?

router.post('/register', function(req, res) {

var username = req.body.username; var password = req.body.password;

// Grab user fields. if (!username || !password) { return res.render('register', { title: 'Register', error: 'Email and password required.' }); }

// Initialize our Stormpath client. var apiKey = new stormpath.ApiKey( process.env['STORMPATH_API_KEY_ID'], process.env['STORMPATH_API_KEY_SECRET'] ); var spClient = new stormpath.Client({ apiKey: apiKey });

var app = spClient.getApplication(process.env['STORMPATH_APP_HREF'], function(err, app) { if (err) throw err;

account = {

  givenName: 'John',
  surname: 'Smith',
  username: username,
  email: username,
  password: password, …
Run Code Online (Sandbox Code Playgroud)

node.js express stormpath passport.js

2
推荐指数
1
解决办法
549
查看次数

如何从express-stormpath库中自定义logout的redirectURL?

我正在使用express-stormpath来处理我的nodejs应用程序的用户管理功能.当/logout路线被访问时,默认的redirectUrl是/.我试图 /login 在访问后将 用户重定向到/logout.根据文档,可以通过redirectUrl在stormpath中间件中设置选项来自定义重定向逻辑,如下所示:

app.use(stormpath.init(app, {
  redirectUrl: '/dashboard',
}));
Run Code Online (Sandbox Code Playgroud)

但是,设置此选项似乎只影响和的重定向逻辑,/login/register不是/logout.

我尝试了以下代码,但是它没有用.

app.use(stormpath.init(app, {
  logoutUrl: {
    redirectUrl: '/login' 
  }
}));
Run Code Online (Sandbox Code Playgroud)

routes node.js express stormpath

2
推荐指数
1
解决办法
233
查看次数

StormPath Spring Boot集成 - 获取无效的CORS请求错误

尝试将StormPath与Spring Boot集成,接收多个错误.以下是应用程序设置.

使用stormpath-default-spring-boot-starter 1.2.1版.

1) application.properties contains only stormpath id, secret and href as follows,

stormpath.client.apiKey.id = <id>
stormpath.client.apiKey.secret = <secret>
stormpath.application.href = <href>

2) SpringSecurityWebAppConfig.Java (Override spring security)

@Configuration
public class SpringSecurityWebAppConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.apply(stormpath());
    }
}

When application is run,
------------------------
1) http://localhost:8080/register renders register screen. 

2) http://localhost:8080/login (GET) throws error "Unable to invoke StormPath controller: Resolved account store cannot be an Organization".

3) http://localhost:8080/login (POST)  (from PostMan) throws …
Run Code Online (Sandbox Code Playgroud)

java cors spring-boot stormpath

2
推荐指数
1
解决办法
618
查看次数