usememos / memos

An open-source, lightweight note-taking solution. The pain-less way to create your meaningful notes. Your Notes, Your Way.
https://usememos.com
MIT License
34.07k stars 2.47k forks source link

Can't create SSO #3450

Closed betterthanever2 closed 5 months ago

betterthanever2 commented 5 months ago

Describe the bug

I'm trying to set up SSO with Authentik. I got all the required pieces (as per step 6 of this article https://www.usememos.com/docs/advanced-settings/keycloak), then tried adding SSO via the UI, and ... nothing. When I click "create" after filling all the required fields, nothing happens; the pop-up remains where it is, no fields are emphasized as having an error or something; nothing happens. Not sure why, or what to do about it.

Steps to reproduce

  1. Go to "Settings" -> "SSO"
  2. Click "create"
  3. Select "Custom" for template in the pop-up
  4. Fill in the fields
  5. Click "create"

The version of Memos you're using

0.22

Screenshots or additional context

OS: Ubuntu 24f

greirson commented 5 months ago

Hey @betterthanever2, I just got mine setup with Authentik. Is the create button blue or grey'd out? Can you confirm you have all the required fields with the red * filled in, including identifier?

Here's what mine looks like in the UI image

betterthanever2 commented 5 months ago

Hi. Mine look pretty much the same. The "update" button is blue and looks active. However, nothing happens when I click on it

greirson commented 5 months ago

Could you attach docker logs? Also any errors in the browser console?

betterthanever2 commented 5 months ago

Sure. Here's screenshot: image

Here's the console output:

ClientError: /memos.api.v1.IdentityProviderService/CreateIdentityProvider INTERNAL: failed to create identity provider, error: sql: converting argument $2 type: unsupported type impl.EnumInfo, a struct
    st https://memos.subjective.place/assets/index-BgLbTvS8.js:286
    ClientError https://memos.subjective.place/assets/index-BgLbTvS8.js:286
    makeCall https://memos.subjective.place/assets/index-BgLbTvS8.js:287

Corresponding log in the container:

memos  | 2024/05/26 06:22:32 ERROR server error method=/memos.api.v1.IdentityProviderService/CreateIdentityProvider error="rpc error: code = Internal desc = failed to create identity provider, error: sql: converting argument $2 type: unsupported type impl.EnumInfo, a struct"
beastarman74 commented 5 months ago

I am experiencing the same issue and error when trying to create a custom entry for Authelia.

For me it is when using a PostgreSQL database. If I use the default settings it will create the sso entry without issue and it is functional. I have not tried mysql at the moment.

betterthanever2 commented 5 months ago

For me it is when using a PostgreSQL database.

My setup is also with Postgres, so this gotta be the root cause.

boojack commented 5 months ago

ClientError: /memos.api.v1.IdentityProviderService/CreateIdentityProvider INTERNAL: failed to create identity provider, error: sql: converting argument $2 type: unsupported type impl.EnumInfo, a struct st https://memos.subjective.place/assets/index-BgLbTvS8.js:286 ClientError https://memos.subjective.place/assets/index-BgLbTvS8.js:286 makeCall https://memos.subjective.place/assets/index-BgLbTvS8.js:287

Fixed with https://github.com/usememos/memos/commit/423861d48c4436539fae1dd88dbcf6e2890efb43

beastarman74 commented 5 months ago

Working for me now. Thanks for the super quick turnaround.