ADAL:返回的现时符合

时间:2016-10-09 14:16:57

标签: ruby sinatra omniauth azure-active-directory adal

我收到此处显示的确切错误“https://github.com/AzureAD/omniauth-azure-activedirectory/issues/22”。

根据原始海报,我在完全相同的位置得到错误“

JWT::DecodeError at /auth/azureactivedirectory/callback
Returned nonce did not match.
file: azure_activedirectory.rb location: validate_and_parse_id_token line: 289

请帮忙。我正在遵循这里的确切示例(对于sinatra):

https://github.com/AzureAD/omniauth-azure-activedirectory

require 'sinatra'
require 'omniauth-azure-activedirectory'

set :port, 8081

configure do
  enable :sessions

  use OmniAuth::Builder do
    provider :azure_activedirectory, ENV['AAD_CLIENT_ID'], ENV['AAD_TENANT']
end

helpers do
  def current_user
    !session[:uid].nil?
  end
end

before do
  pass if request.path_info =~ /^\/auth\//

  redirect to('/auth/azureactivedirectory') unless current_user
end

get '/auth/azureactivedirectory/callback' do
  session[:uid] = env['omniauth.auth']['uid']
  redirect to('/')
end

get '/auth/failure' do
  'I am crying!'
end

get '/' do
  puts 'Spot 4'
  puts env['omniauth.auth'].to_s
  request.env['omniauth.auth'].to_s
end

任何帮助都将不胜感激。

0 个答案:

没有答案