Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. OpenID Connect Server not working in Outline Notes

OpenID Connect Server not working in Outline Notes

Scheduled Pinned Locked Moved Solved Support
oidc
9 Posts 3 Posters 1.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • njN Offline
    njN Offline
    nj
    wrote on last edited by girish
    #1

    The app gets stuck in a loop: auth -> tocloudron -> auth page. The following error is thrown by Outline:

    Highlight: "UnauthorizedError: An email field was not returned in the profile parameter, but is required."

    I think the provider isn't sending back the user's email? Please check. Simply replacing the url of my.cloudron.tld to that of keycloak works, so there's something missing bit in the Cloudron implementation. Thanks!

    {"error":"An email field was not returned in the profile parameter, but is required.","stack":"UnauthorizedError: An email field was not returned in the profile parameter, but is required.\n at AuthenticationError (/app/code/build/server/errors.js:38:34)\n at OAuth2Strategy._verify (/app/code/build/server/routes/auth/providers/oidc.js:60:47)\n at /app/code/node_modules/passport-oauth2/lib/strategy.js:196:24\n at OAuth2Strategy._passportOauth.Strategy.userProfile (/app/code/build/server/routes/auth/providers/oidc.js:32:12)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","level":"error","message":"Error during authentication"}
    

    Founder / Coder • My Apps

    nebulonN 1 Reply Last reply
    1
    • njN nj

      The app gets stuck in a loop: auth -> tocloudron -> auth page. The following error is thrown by Outline:

      Highlight: "UnauthorizedError: An email field was not returned in the profile parameter, but is required."

      I think the provider isn't sending back the user's email? Please check. Simply replacing the url of my.cloudron.tld to that of keycloak works, so there's something missing bit in the Cloudron implementation. Thanks!

      {"error":"An email field was not returned in the profile parameter, but is required.","stack":"UnauthorizedError: An email field was not returned in the profile parameter, but is required.\n at AuthenticationError (/app/code/build/server/errors.js:38:34)\n at OAuth2Strategy._verify (/app/code/build/server/routes/auth/providers/oidc.js:60:47)\n at /app/code/node_modules/passport-oauth2/lib/strategy.js:196:24\n at OAuth2Strategy._passportOauth.Strategy.userProfile (/app/code/build/server/routes/auth/providers/oidc.js:32:12)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","level":"error","message":"Error during authentication"}
      
      nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by nebulon
      #2

      @nj are you setting the email scope?

      It may be that your Keycloak client settings automatically add email claims by default, for the standard OpenID those have to be specified when the client flow is initiated https://docs.cloudron.io/user-management/#scopes-and-claims

      njN 1 Reply Last reply
      0
      • nebulonN nebulon

        @nj are you setting the email scope?

        It may be that your Keycloak client settings automatically add email claims by default, for the standard OpenID those have to be specified when the client flow is initiated https://docs.cloudron.io/user-management/#scopes-and-claims

        njN Offline
        njN Offline
        nj
        wrote on last edited by nj
        #3

        @nebulon said in OpenID Connect Server not working in Outline Notes:

        It may be that your Keycloak client settings automatically add email claims by default, for the standard OpenID those have to be specified when the client flow is initiated https://docs.cloudron.io/user-management/#scopes-and-claims

        But it's the Outline app that initiates auth request with the Cloudron OpenID Connect server. I tried both preferred_username as well as sub but none worked. All other settings match with Cloudron's recommendations.

        Is it because profile doesn't include email ?

        Founder / Coder • My Apps

        1 Reply Last reply
        1
        • nebulonN Offline
          nebulonN Offline
          nebulon
          Staff
          wrote on last edited by
          #4

          That is correct, profile does not usually include email. See https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes for more detail there.

          The app, in your case Outline has to request an auth flow with those scopes, so the app needs to tell the openID provider which properties (based on scope and claims) it should deliver. For which scopes have you configure Outline? It seems the default is already all three typical OpenID ones https://docs.getoutline.com/s/hosting/doc/oidc-8CPBm6uC0I

          1 Reply Last reply
          1
          • njN Offline
            njN Offline
            nj
            wrote on last edited by
            #5

            I understood that profile doesn’t include “email” and email is a separate scope. But still with stock setup in Keycloak vs Cloudron, the Keycloak version works and Cloudron version of the provider doesn’t work. This is what’s strange.

            Founder / Coder • My Apps

            1 Reply Last reply
            0
            • nebulonN Offline
              nebulonN Offline
              nebulon
              Staff
              wrote on last edited by
              #6

              So if you add that scope to the app's setting, does it work then or is it still not working?

              1 Reply Last reply
              0
              • njN Offline
                njN Offline
                nj
                wrote on last edited by
                #7

                I'm sorry, it was an error on my part. I had used the URL /openid/userinfo instead of /openid/me.

                Founder / Coder • My Apps

                1 Reply Last reply
                1
                • nebulonN Offline
                  nebulonN Offline
                  nebulon
                  Staff
                  wrote on last edited by
                  #8

                  Ah right, I had initially an alias set, since both seem to be used on equal basis, however since in my experience many apps rely on the info of the well-known, I removed that again. It's also documented in the main openid settings page.

                  1 Reply Last reply
                  1
                  • girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #9

                    Link to docs for future reference - https://docs.cloudron.io/user-management/#endpoints

                    1 Reply Last reply
                    1
                    • girishG girish marked this topic as a question on
                    • girishG girish has marked this topic as solved on
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Bookmarks
                    • Search