私はStormpath ID Siteを使用するexpress-stormpathアプリケーションを持っています。それはこの構成を持っています:express-stormpathとstormpath-sdk-angularjsを使用してStormpath IDサイトからログアウトするにはどうすればよいですか?
app.use(stormpath.init(app, {
web: {
idSite: {
enabled: true,
uri: '/idSiteResult',
nextUri: '/'
},
login: {
enabled: true,
uri: config.login
},
logout: {
enabled: true,
uri: config.logout
},
me: {
expand: {
customData: true,
groups: true
}
}
}
}));
ログインはうまくいっていますが、ログアウトすると問題が起こります。
まず、私は
$auth.endSession();
)内蔵のENDSESSION stormpath-SDK-angularjs(とログアウトしてみました。しかし、私はまだログインしていた。
を明示-stormpathに掘り、それは次のようになりますlogout POST requires Accept type text/html for id-site logout。 stormpath-sdk-angularjsでは、それはendSession POST uses application/jsonのように見えます。
は、だから私は$ http.post
$http.post('/logout', null, {
headers: {
'Accept': 'text/html'
}
});
でログアウトしようとしたしかし、私はこのエラーを取得する:
XMLHttpRequest cannot load https://api.stormpath.com/sso/logout?jwtRequest=[...] . Redirect from ' https://api.stormpath.com/sso/logout?jwtRequest=[...] ' to ' http://localhost:9000/idSiteResult?jwtResponse=[...] ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://localhost:9000 ' is therefore not allowed access.
にはどうすればStormpath IDサイトからログアウトしますか?
あなたは特急サーバー上csurfを使用している場合、また、送信してくださいフォームのXSRF-TOKEN(および_csrfクッキーではない) – ryan