LoginSignup
0
0

More than 1 year has passed since last update.

omniauth-samlでログイン後にセッションが消える

Last updated at Posted at 2021-10-26

omniauthを既に使っていてたため、omniauth-samlを使ってSAML対応することになったけど、SAMLの承認自体は通るもののその後セッションが持続せず毎回ログアウトされるようになっていた。

結論

omniauth_callbacks_controller.rb
protect_from_forgery except: [:saml]

自前のstrategyを持っていたりしてどこでtokenが消失するのかとかを追っていたけど、単純にprotect_from_forgeryで消されていただけだった。
今まで使っていたomniauth-google-oauth2がexceptしなくても動いていたので気づくのに時間がかかった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0