Even when creating the state myself it got the same error. ``` ruby session['omniauth.state'] = SecureRandom.hex(24) redirect_to "/auth/google_oauth2?state=#{session['omniauth.state']}" ``` Even though the returned state is the same, meaning it should match ! Isn't there a double redirect or something ? Because if so the : ``` 'ruby request.params['state'] != session.delete('omniauth.state') ``` in https://github.com/intridea/omniauth-oauth2/blob/master/lib/omniauth/strategies/oauth2.rb#L72 would explain the problem. => First passes, second fail. https://stackoverflow.com/questions/22386149/why-am-i-getting-csrf-detected-with-omniauth-and-google/23739564#23739564