Open ipepe opened 5 years ago
Ahhh. Sorry. I was using new V2 signin and I guess that's not compatible with Your implementation.
Also implementation at github.com/xapix-io/omniauth-azure_active_directory_b2c seems more advanced. Maybe pull request it?
@ipepe, it got to the callback_phase
and it got past the checks for error codes and error messages. It seems the access_token
is missing from the response, or the returned token hasn't been decoded correctly. Can you post the response you're getting in the callback_phase
as well as the keys and what not?
Also, I checked out the fork by xapix-io. The auto-discovery functionality is cool, but it looks like it comes at the expense of being able to use multiple policies which I purposefully included. Additionally, I think it may fetch the well-known config on every request. I'm just not sure without further investigation. Either way, it would have been better if it was implemented as a subclass of policy or as injectable functionality.
Currently I'm ussing xapix-io/omniauth-azure_active_directory_b2c with V1 because that's the only version that works for me. Going out for holidays tomorrow so I'm putting this feature on hold in my project for now.
@br3nt I seem to be getting the same response. However when I do the process manually, the access_token is indeed not included from Microsoft's side
@kylegani What is being returned from Microsoft? I'm assuming there should at least be an error message that's not being picked up by the validate_callback_response!
method.
Also, what authorization flow are you using? If you're not using the code
flow then that may be the problem.
If you haven't already, I would set up your strategy as per the Advanced Configuration docs. This will enable you to override some of the callback functions in the strategy and use a tool like pry
to debug.
You'll then be able to look at the request
object and request.params
to see what is being returned from Microsoft.
Example:
module OmniAuth
module Strategies
class YourB2CStrategy < AzureActiveDirectoryB2C
option :name, 'your_b2c_strategy'
def request_phase
binding.pry
super
rescue => e
binding.pry
raise
end
def callback_phase
binding.pry
super
rescue => e
binding.pry
raise
end
def validate_callback_response!
binding.pry
super
rescue => e
binding.pry
raise
end
end
end
end
OmniAuth.config.add_camelization('your_b2c_strategy', 'YourB2C')
use OmniAuth::Builder do
provider :your_b2c_strategy
end
I seem to have problem running this gem. When coming back from azure to my callback in rails I have exception:
Could You help @br3nt ?