Skip to content

[Bug][OIDC]: undefined method `+' for nil:NilClass #1461

Closed

Description

@yiukamsum

部署方式 | How to Deploy

Docker (Default)

部署版本 | Version

5.2.2-nightly

Git 哈希值 (长度 40)| Git Ref (40 length)

2c9ed76

反代服务 | Reverse Proxy

cloudflare (== nginx)

HTTPS 证书类型 | HTTPS(SSL)

可受信任的证书 Verified SSL

已阅读文档 | Read the document

  • 已阅读 | Yes

描述 | Description

我使用 OpenID Connect (Microsoft Azrue AD) 進行登入時,出現 500

问题日志 | Relevant log output

method=GET path=/users/auth/openid_connect/callback format=html controller=Users::OmniauthCallbacksController action=openid_connect status=500 allocations=1327 duration=62.54 view=0.00 db=0.44 time=2024-04-03 15:28:55 +0800 exception=["NoMethodError", "undefined method `+' for nil:NilClass"] exception_object=undefined method `+' for nil:NilClass ip=172.24.0.2 username=guest

Activity

  1. welcome commented on Apr 3, 2024

    @welcome

    感谢你提交的问题或反馈,我会在有时间的时候回复在此期间你可以看看之前被解决的反馈说不定有你需要的答案。
    Thanks for opening this issue, a maintainer will get back to you shortly!

  2. yiukamsum commented on Apr 3, 2024

    @yiukamsum
    ContributorAuthor

    Just found out is the OIDC server returning nil for email. May be adding a error msg instead of returning 500? Or allow admin map the corresponding to the mail field. Seems Microsoft Azure AD always return the email field to another field.

    I am not good at ruby. XD

    Btw I have opened a PR. Let see how to optimize it.

    variable auth in debugger:

    #<OmniAuth::AuthHash credentials=#<OmniAuth::AuthHash expires_in="3599" id_token="id_token" scope=nil token="token"> extra=#<OmniAuth::AuthHash raw_info=#<OmniAuth::AuthHash amr=#<Hashie::Array ["rsa", "mfa"]> aud="uuid" exp=1712157534 family_name="Last Name" given_name="First Name" iat=iat ipaddr="182.239.115.19" iss="https://sts.windows.net/1fdf6955-f083-49cd-bbeb-8877c2de59e7/" name="Benedict" nbf=nbf nonce="85a5d6864e72ef1b73f35fbb625e087e" oid="oid" rh="rh" sub="sub" tid="tid" unique_name="EMAIL_HERE" upn="EMAIL_HERE" uti="uti" ver="1.0">> info=#<OmniAuth::AuthHash::InfoHash email=nil email_verified=nil first_name="First Name" gender=nil image=nil last_name="Last Name" name="Benedict" nickname=nil phone=nil urls=#<OmniAuth::AuthHash website=nil>> provider="OIDC Provider" uid="uid">
    
  3. icyleaf commented on Apr 3, 2024

    @icyleaf
    Member

    Email address is actually not necessary for using the third party login account, I have revised this part of the logic so that the current problem will no longer occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions