-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Hello,
While navigating to /auth/facebook works fine, I cannot make a client side flow work properly.
The reason for preferring a client side flow is to authorize FB in a popup so that the user never leaves our site.
I have initialized the FB JS app with the app id and cookie set to true.
FB.init({
appId : appId,
cookie : true,
xfbml : true,
version : 'v2.12'
});
However in my case the failure callback is getting called on my auth controller because ueberath cannot find the code.
def callback(%{assigns: %{ueberauth_failure: _fails}} = conn, _params) do
conn
|> put_flash(:error, "Failed to authenticate.")
|> redirect(to: "/")
end
Line of code in current project
The issue is that ueberauth_facebook does not read the code from the fb signed request cookie in case it cannot find it in the params.
Omniauth extracts the authorization code from the cookie like this:
omniauth code that extracts code either from params or cookie
The cookie value is Base64 encoded and signed with HMAC-SHA256.
Could this be done here as well to support the client-initiated flow?
Omniauth client side flow documentation
Thanks in advance,
Mark