Try ERPNext Buy Support Partners Foundation

Social Login Office 365 AADSTS50011

I follow the instructions on https://frappe.io/docs/user/en/guides/deployment/how-to-enable-social-logins
but I have a problem erro on return URL
“AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: …”

I have check the same URL URI return https://login.microsoftonline.com/common/oauth2/authorize?redirect_uri=https%3A%2F%2Ferpnext.mntb.org.br%2Fapi%2Fmethod%2Ffrappe.integrations.oauth2_logins.login_via_office365&state=eyJzaXRlIjo....aaa&response_type=code&scope=openid&client_id=5613b138-d693-4fba-adbc-8c4c7d33c679&sso_reload=true

I do not know how to resolve this problem.

Any one can help me?

We are encountering the same issue.

1 Like

I check and the URI on azure was wrong. I fix and now I have thi error

Server Error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1042, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2_logins.py”, line 28, in login_via_office365
login_via_oauth2_id_token(“office_365”, code, state, decoder=decoder_compat)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/oauth.py”, line 116, in login_via_oauth2_id_token
info = get_info_via_oauth(provider, code, decoder, id_token=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/oauth.py”, line 148, in get_info_via_oauth
frappe.throw(_(“Email not verified with {0}”).format(provider.title()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 364, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 350, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: E-mail não verificado com Office_365

how can I resolve this?

Hi @Rodrigo_Rafael,

We manage to fix it by going in Azure-> App Registration->Token Configuration and choose Add optional claim and select email for all 3 Access, Token, SAML might work with just one but have not tested

Alex

1 Like

Ok, thankyou!!
It is working now!!

But how can I configure the default user permitions for new users with social login?

Update field, “Default Role at Time of Signup” on “Portal Settings” Page