Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Setup Multi tenant

Tomas Valent edited this page Jan 13, 2017 · 1 revision

Gem natively don't support Multi Tenant setup

you need to Monkey Patch gem (till this is fixed)

module OmniAuth
  module Strategies
    class AzureActiveDirectory
      def raw_authorize_endpoint_url
        'https://login.microsoftonline.com/common/oauth2/authorize'
      end

      def authorize_endpoint_url
        uri = URI(raw_authorize_endpoint_url)
        uri.query = URI.encode_www_form(client_id: client_id,
                                        redirect_uri: callback_url,
                                        response_mode: response_mode,
                                        response_type: response_type,
                                        nonce: new_nonce)
        uri.to_s
      end

      def verify_options
        { verify_expiration: true,
          verify_not_before: true,
          verify_iat: true,
          verify_aud: true,
          'aud' => client_id }
      end
    end
  end
end

discussion here https://github.com/AzureAD/omniauth-azure-activedirectory/issues/25

Clone this wiki locally