Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feedback] OpenID and multi-user #4029

Open
matt-fidd opened this issue Dec 23, 2024 · 59 comments
Open

[Feedback] OpenID and multi-user #4029

matt-fidd opened this issue Dec 23, 2024 · 59 comments
Labels
experimental feature Related to an experimental feature feedback Single feedback thread for bug reports on a new feature

Comments

@matt-fidd
Copy link
Contributor

matt-fidd commented Dec 23, 2024

Thanks to @lelemm, OpenID and multi-user support was added to Actual in #3878 as an experimental feature. This issue is to track feedback/bugs/issues/requests related specifically to that feature.

@matt-fidd matt-fidd added bug Something isn't working experimental feature Related to an experimental feature feedback Single feedback thread for bug reports on a new feature and removed bug Something isn't working labels Dec 23, 2024
@shaankhosla
Copy link
Contributor

shaankhosla commented Dec 24, 2024

Thanks @lelemm for this amazing feature!

I'm having some trouble setting this up with Authelia. I'm getting the following error after trying to sign in with OpenId:

status	"error"
reason	"openid-grant-failed"

When I look at the logs for Actual I see the following:

2024-12-24T02:24:06.997Z info: GET 200 /account/needs-bootstrap
2024-12-24T02:24:07.054Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.107Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.168Z info: GET 200 /admin/owner-created/
Logging in via openid
2024-12-24T02:24:08.554Z info: POST 200 /account/login
OpenID grant failed: RPError: iss missing from the response
    at Client.callback (/app/node_modules/openid-client/lib/client.js:436:13)
    at loginWithOpenIdFinalize (file:///app/src/accounts/openid.js:177:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/src/app-openid.js:86:24 {
  params: {
    code: '<redacted>',
    state: '<redacted>'
  }
}

Anyone know what I might be doing wrong?

@lelemm
Copy link
Contributor

lelemm commented Dec 24, 2024

I'm not on the PC right now, but maybe authelia does not implement openid, but oauth2.

If that's the case, you have to setup it using the config.json on the server specifying the authMethod to oauth2 instead of openid
Check this PR for more details https://github.com/actualbudget/actual-server/pull/527/files

Thanks @lelemm for this amazing feature!

I'm having some trouble setting this up with Authelia. I'm getting the following error after trying to sign in with OpenId:

status	"error"
reason	"openid-grant-failed"

When I look at the logs for Actual I see the following:

2024-12-24T02:24:06.997Z info: GET 200 /account/needs-bootstrap
2024-12-24T02:24:07.054Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.107Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.168Z info: GET 200 /admin/owner-created/
Logging in via openid
2024-12-24T02:24:08.554Z info: POST 200 /account/login
OpenID grant failed: RPError: iss missing from the response
    at Client.callback (/app/node_modules/openid-client/lib/client.js:436:13)
    at loginWithOpenIdFinalize (file:///app/src/accounts/openid.js:177:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/src/app-openid.js:86:24 {
  params: {
    code: '<redacted>',
    state: '<redacted>'
  }
}

Anyone know what I might be doing wrong?

@shaankhosla
Copy link
Contributor

I'm not on the PC right now, but maybe authelia does not implement openid, but oauth2.

If that's the case, you have to setup it using the config.json on the server specifying the authMethod to oauth2 instead of openid Check this PR for more details https://github.com/actualbudget/actual-server/pull/527/files

Thanks @lelemm for this amazing feature!
I'm having some trouble setting this up with Authelia. I'm getting the following error after trying to sign in with OpenId:

status	"error"
reason	"openid-grant-failed"

When I look at the logs for Actual I see the following:

2024-12-24T02:24:06.997Z info: GET 200 /account/needs-bootstrap
2024-12-24T02:24:07.054Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.107Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.168Z info: GET 200 /admin/owner-created/
Logging in via openid
2024-12-24T02:24:08.554Z info: POST 200 /account/login
OpenID grant failed: RPError: iss missing from the response
    at Client.callback (/app/node_modules/openid-client/lib/client.js:436:13)
    at loginWithOpenIdFinalize (file:///app/src/accounts/openid.js:177:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/src/app-openid.js:86:24 {
  params: {
    code: '<redacted>',
    state: '<redacted>'
  }
}

Anyone know what I might be doing wrong?

Thanks, I'll dig around! I think Authelia has OpenID based on this, but I'll try the config.json.

@shaankhosla
Copy link
Contributor

I'm not on the PC right now, but maybe authelia does not implement openid, but oauth2.
If that's the case, you have to setup it using the config.json on the server specifying the authMethod to oauth2 instead of openid Check this PR for more details https://github.com/actualbudget/actual-server/pull/527/files

Thanks @lelemm for this amazing feature!
I'm having some trouble setting this up with Authelia. I'm getting the following error after trying to sign in with OpenId:

status	"error"
reason	"openid-grant-failed"

When I look at the logs for Actual I see the following:

2024-12-24T02:24:06.997Z info: GET 200 /account/needs-bootstrap
2024-12-24T02:24:07.054Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.107Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.168Z info: GET 200 /admin/owner-created/
Logging in via openid
2024-12-24T02:24:08.554Z info: POST 200 /account/login
OpenID grant failed: RPError: iss missing from the response
    at Client.callback (/app/node_modules/openid-client/lib/client.js:436:13)
    at loginWithOpenIdFinalize (file:///app/src/accounts/openid.js:177:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/src/app-openid.js:86:24 {
  params: {
    code: '<redacted>',
    state: '<redacted>'
  }
}

Anyone know what I might be doing wrong?

Thanks, I'll dig around! I think Authelia has OpenID based on this, but I'll try the config.json.

I tried with the config.json and set the authMethod to "oauth2" but still got the same error.

@lelemm
Copy link
Contributor

lelemm commented Dec 24, 2024

I'm not on the PC right now, but maybe authelia does not implement openid, but oauth2.
If that's the case, you have to setup it using the config.json on the server specifying the authMethod to oauth2 instead of openid Check this PR for more details https://github.com/actualbudget/actual-server/pull/527/files

Thanks @lelemm for this amazing feature!
I'm having some trouble setting this up with Authelia. I'm getting the following error after trying to sign in with OpenId:

status	"error"
reason	"openid-grant-failed"

When I look at the logs for Actual I see the following:

2024-12-24T02:24:06.997Z info: GET 200 /account/needs-bootstrap
2024-12-24T02:24:07.054Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.107Z info: GET 304 /account/needs-bootstrap
2024-12-24T02:24:07.168Z info: GET 200 /admin/owner-created/
Logging in via openid
2024-12-24T02:24:08.554Z info: POST 200 /account/login
OpenID grant failed: RPError: iss missing from the response
    at Client.callback (/app/node_modules/openid-client/lib/client.js:436:13)
    at loginWithOpenIdFinalize (file:///app/src/accounts/openid.js:177:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/src/app-openid.js:86:24 {
  params: {
    code: '<redacted>',
    state: '<redacted>'
  }
}

Anyone know what I might be doing wrong?

Thanks, I'll dig around! I think Authelia has OpenID based on this, but I'll try the config.json.

I tried with the config.json and set the authMethod to "oauth2" but still got the same error.

To use the configuration in the file, you need to run the commands.
First disable the openid
yarn/npm run disable-openid
Then run
yarn/npm run enable-openid

This script will take the configuration from the file into the database

@shaankhosla
Copy link
Contributor

Ah thanks, I didn't realize I had to run that command for it to use the config. That worked! I had to switch my docker container from edge-alpine to just edge to have npm in it.

@shaankhosla
Copy link
Contributor

Actually, that seemed like it fixed the issue but I don't think it did.

After I run those commands I'm able to sign in (with account A) and assign a budget file to myself as admin. However, if I try to sign in through a different user account (with account B) in incognito mode I get the same openid-grant-failed error I was seeing before. I then re-ran the disable/enable commands again and signed in with account B, at which point account B became the admin and I couldn't see account A in the user directory list. Then I tried signing in with account A and got the same openid-grant-failed error as before.

@lelemm
Copy link
Contributor

lelemm commented Dec 24, 2024

You have to give access to the second user in the user directory

@lelemm
Copy link
Contributor

lelemm commented Dec 24, 2024

@shaankhosla https://deploy-preview-447.www.actualbudget.org/docs/experimental/multi-user

@shaankhosla
Copy link
Contributor

Got it, it's working as expected. I thought that new users would be added to that automatically at sign in. Thanks for all of your help!

@feyleth
Copy link

feyleth commented Dec 29, 2024

it is possible to use multi-user without need to login with openID ?

@lelemm
Copy link
Contributor

lelemm commented Dec 29, 2024

it is possible to use multi-user without need to login with openID ?

Nope. They are tied together for now. One can expand for internal user management

@alexsalex
Copy link

HI! Thank you for this future! Amazing!

But could you write some documentation about it? For example: what is the redirect URL for OAuth2?

@lelemm
Copy link
Contributor

lelemm commented Jan 2, 2025

https://your-actual-server-domain:your-actual-server/openid/callback

@nichtdu
Copy link

nichtdu commented Jan 7, 2025

just added via authentik. worked flawless so far. Enabling was quiet easy as well.

The fact that it deletes the url in case you change auth-provider in setup is a little confusing though - or rather the fact that it accepts invalid url and does not tell you (it resetted to placeholders but i did not notice and hit ok again - and i was not able to see error on first sight)

@mocdaniel
Copy link

I noticed that arbitrary users seem to be able to access budget files of other users as long as they log in from the same device.

Consider the following situation - I got two users in my IAM solution (Authentik), one is called Daniel Bodky and is Admin in Actualbudget, the other is called John Doe and got added to the user directory of Actualbudget manually:

Screenshot 2025-01-07 at 12 26 24

There is only one budget file available on the server, called Daniel. It has been created by the admin user and is configured to be accessible only by him:

Screenshot 2025-01-07 at 12 26 32

However, if I log in to Actualbudget with the second user John Doe, I am offered to open the budget file. It even states that the supposedly unprivileged user is the file owner. Consequently, I can open and edit the budget with the unprivileged user (note the username in the top right):

Screenshot 2025-01-07 at 12 24 23

Screenshot 2025-01-07 at 12 25 10

If I login as John Doe from a private browser window, the behavior is as expected: The user doesn't have a budget file yet, so none is displayed; the budget file(s) of other users don't show either.

Screenshot 2025-01-07 at 12 24 27

I guess this is due to the offline capabilities of Actualbudget, and the fact that all local files are available in the device/browser? So once a budget file has been downloaded to a device/browser, it's accessible to all users that might log in on that device/browser?

@lelemm
Copy link
Contributor

lelemm commented Jan 7, 2025

I guess this is due to the offline capabilities of Actualbudget, and the fact that all local files are available in the device/browser? So once a budget file has been downloaded to a device/browser, it's accessible to all users that might log in on that device/browser?

You are completely right. That's how its working atm

@mocdaniel
Copy link

Are there plans to mitigate this behavior in the future? Maybe by 'disabling' offline mode when enabling OIDC auth/multi-user support?

@lelemm
Copy link
Contributor

lelemm commented Jan 7, 2025

AFAIK, not planned, but I guess with enough feedback for it will probably be mitigated

@ReclaimedBytes
Copy link

Working well here with Pocket ID. Thanks for implementing!

@lelemm
Copy link
Contributor

lelemm commented Jan 7, 2025

Would be nice if someone is using a different OpenID provider, give some information like this:

    {
      label: 'Microsoft Entra',
      value: 'microsoft',
      issuer: 'https://login.microsoftonline.com/{tenant-id}',
      clientIdRequired: true,
      clientSecretRequired: true,
      tip: (
        <Link
          variant="external"
          to="https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc"
        >
          <Trans>OpenID Connect on the Microsoft identity platform</Trans>
        </Link>
      ),
    }

So the list of validated providers can be increased for future users

@ReclaimedBytes
Copy link

Where would I find that?

@lelemm
Copy link
Contributor

lelemm commented Jan 7, 2025

Where would I find that?

That would be built by you, if you have the knowledge

@woolfyx
Copy link

woolfyx commented Jan 7, 2025

Firstly, thanks for this great features ! 😍

Quick question regarding claims used to retrieve user information.Actually, at least for Entra ID, the username seems to be mapped to the display name? Is it correct? Maybe it can be interesting to be customized to use the UPN (which is unique in Entra ID - not sure it's the case for display name), for example?

This question aside, authentication process works perfectly.

@lelemm
Copy link
Contributor

lelemm commented Jan 7, 2025

Firstly, thanks for this great features ! 😍

Quick question regarding claims used to retrieve user information.Actually, at least for Entra ID, the username seems to be mapped to the display name? Is it correct? Maybe it can be interesting to be customized to use the UPN (which is unique in Entra ID - not sure it's the case for display name), for example?

This question aside, authentication process works perfectly.

The username saved is a little clunky honestly.
in the spec, there are definitions of the name of the fields, but I guess some providers just do what they want lol.
probably for Entra Id is catching a bad value (on the big list of possible values).

@Arnoud-B
Copy link

Arnoud-B commented Jan 7, 2025

To test this, I:

  1. Created an account on auth0, created a (fake) web app and created a user there. For the callback URL I used https://actual.domain.com:5006/openid/callback.
  2. Attempted a sign in with the user I created on auth0 and got an error message. I went back to the login page to try again, and now it logged me in automatically (weird?).
  3. I opened a budget file, which worked. But when closing the budget file, it says: "Owner: Unassigned". Another budget file is showing the same, and a third (test) budget file is showing "Owner: Server". I expected the Owner to be the first OpenID user to open the budget file.

@deathblade666
Copy link
Contributor

deathblade666 commented Jan 7, 2025

Is it expected that basic users cannot link bank accounts? It seems only the admin can link bank accounts now, while I would expect basic users that are owners of the current budget file to also be able to link bank accounts (it's their own budget, after all). Would be a pain for the admin to manage this for all users too (where every account needs to log in again every 180 days, with the login details of the user and not the admin).

lelemm will have to comment on access, but i know as of current if you have bank sync setup it is not per budget. that is to say, the token with the sync provider is set on the server and not associated with the budget files directly.

@cromelex
Copy link

cromelex commented Jan 8, 2025

Okay I managed to get this working with Authelia, thanks to the above.

For Authelia, I added the following to configuration.yml and then restarted it.

identity_providers:
  oidc:
    ## The other portions of the mandatory OpenID Connect 1.0 configuration go here.
    ## See: https://www.authelia.com/c/oidc
    clients:
    # Actual
      - client_id: 'actualbudget'
        client_name: 'Actual'
        client_secret: ''$pbkdf2-digestedsecret'
        authorization_policy: 'two_factor'
        redirect_uris:
          - 'https://actualbudget.example.com/openid/callback'
        public: false
        require_pkce: true
        pkce_challenge_method: 'S256'
        grant_types:
          - 'authorization_code'
        scopes:
          - 'openid'
          - 'profile'
          - 'groups'
          - 'email'
        userinfo_signed_response_alg: 'none'
        token_endpoint_auth_method: 'client_secret_basic'

For Actual, I had to create the config.json in /data

{
"openId": {
        "issuer": "https://auth.example.com",
        "client_id": "actual",
        "client_secret": "insecure_secret",
        "server_hostname": "https://actualbudget.example.com",
        "authMethod": "oauth2"
    }
}

Then, go into the actualbudget docker container and run

npm run disable-openid #to ensure it was disabled
Then run
npm run enable-openid

I went back into my Actual-Budget instance, logged out and logged back in, selecting the OpenID option. This triggered the request to Authelia and assigned my user as owner for the budget.

Then I added a second user based on this
https://deploy-preview-447.www.actualbudget.org/docs/experimental/multi-user

ie, https://actualbudget.example.com/user-directory and manually added the 2nd user, and the gave them access to the budget via https://actualbudget.example.com//user-access.

Logged in via Authelia with said user successfully.

Seems to be working as intended!

@bennesp
Copy link

bennesp commented Jan 8, 2025

Am I missing something? When trying to set OpenID via env variables, do I need to set a config.json file or activate things in the UI?
I'm using authentik and I've got: ACTUAL_OPENID_DISCOVERY_URL ACTUAL_OPENID_CLIENT_ID ACTUAL_OPENID_CLIENT_SECRET ACTUAL_OPENID_SERVER_HOSTNAME vars set, but I see nothing in the logs, and actual is still prompting for password only. Is there an env var counterpart for authMethod or is actual supposed to infer that by the env vars?

this has being discussed at discord, take a look here: https://discord.com/channels/937901803608096828/1245792355748155392/1326221059724410901

Can we have it documented somewhere? I had to create a discord user, click many "accept" "skip" and so on 😕

To everyone that do not want to create a discord user, the solution is to run the following command inside the container:

npm run enable-openid --prefix /app

Also:
ACTUAL_OPENID_SERVER_HOSTNAME should be actual-ly (🤭) be called ACTUAL_OPENID_SERVER_URL since it requires the schema (https://)

Thank you for the great progress on this feature though!

@hendrik1120
Copy link

hendrik1120 commented Jan 8, 2025

Hi, I am happy to see the ongoing development of actualbudget and the new addition of SSO using OIDC and OAuth2.0.

I have tested the OpenID feature using the WebUI with Authelia. I get the following error:

{"status":"error","reason":"openid-grant-failed"}
2025-01-08T17:23:08.575Z info: GET 400 /openid/callback?code=authelia_ac_<redacted>&iss=https%3A%2F%2Fauth.example.com&scope=openid+email+profile&state=2gbbP-UK8xj2Gs2pcfRnI724JWRzgTIw_3YSqxqIP7c
OpenID grant failed: RPError: iss missing from the response
    at Client.callback (/app/node_modules/openid-client/lib/client.js:436:13)
    at loginWithOpenIdFinalize (file:///app/src/accounts/openid.js:177:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app/src/app-openid.js:86:24 {
  params: {
    code: 'authelia_ac_<redacted>',
    state: '2gbbP-UK8xj2Gs2pcfRnI724JWRzgTIw_3YSqxqIP7c'
  }
}

To me, this looks like actual is expecting the iss (issuer) parameter to be present in the Authentication Response. However the iss parameter is not required to be present in the response by section 3.1.2.5 of the openid standard or section 4.1.2 of the oauth2.0 standard. Authelia correctly encodes the iss parameter in the IDToken as required.

Actually authelia supports RFC9207 which basically only implements the iss parameter in the Authrization Response. However there must be some sort of issue either in the library used or the implementation where the iss validation fails. The parameter is included in the authelia response:

https://actual.example.com/openid/callback?code=authelia_ac_<redacted>&iss=https%3A%2F%2Fauth.example.com&scope=openid+email+profile&state=2gbbP-UK8xj2Gs2pcfRnI724JWRzgTIw_3YSqxqIP7c

It is possible that I interpreted the error wrong, but I think this might be a bug.

Authelia oidc client configuration for reference:

identity_providers:
  oidc:
    clients:
      - client_id: 'actual'
        client_name: 'actual'
        client_secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng'  # The digest of 'insecure_secret'.
        public: false
        require_pkce: true
        pkce_challenge_method: 'S256'
        authorization_policy: 'two_factor'
        redirect_uris:
          - 'https://actual.example.com/openid/callback'
        scopes:
          - 'openid'
          - 'profile'
          - 'email'
        userinfo_signed_response_alg: 'none'

@ilovepancakes95
Copy link

I was able to setup OpenID Auth using Synology DSM SSO Server with their OIDC feature enabled. I can login to Actual, etc. however what doesn't seem to be working is the setting of the "Server Owner" when the first account logs in after OIDC is enabled. I can see my user in User Directory but there is no check mark next to Server Owner. This causes the warning to still appear on the login page about server owner being set to first user and it also is preventing the regular password login from being disabled.

Any ideas why the server owner isn't be set automatically to first user to login (me) after OIDC setup is enabled, and is there anyway to force set the server owner now... I tried clearing cookies and restarting the docker container and signing in from scratch, didn't help.

@DennaGherlyn
Copy link

[...] it also is preventing the regular password login from being disabled.

Can you even disable the regular password? I'm Server Owner but I still have the option to use the password. And I don't see any settings for that either. I would guess that deactivating the password option is not a thing yet.

@ilovepancakes95
Copy link

[...] it also is preventing the regular password login from being disabled.

Can you even disable the regular password? I'm Server Owner but I still have the option to use the password. And I don't see any settings for that either. I would guess that deactivating the password option is not a thing yet.

Hmm, I was under the impression that once a server owner is set after the first OIDC login happens that it disables regular password based access and goes into multi-user mode only. Maybe I misunderstood, and can't test because my install isn't properly setting server owner by itself anyway and getting rid of the ability to edit OIDC settings before login. So right now, anybody could just edit OIDC settings to their own provider and get in.

@DennaGherlyn
Copy link

[...] it also is preventing the regular password login from being disabled.

Can you even disable the regular password? I'm Server Owner but I still have the option to use the password. And I don't see any settings for that either. I would guess that deactivating the password option is not a thing yet.

Hmm, I was under the impression that once a server owner is set after the first OIDC login happens that it disables regular password based access and goes into multi-user mode only. Maybe I misunderstood, and can't test because my install isn't properly setting server owner by itself anyway and getting rid of the ability to edit OIDC settings before login. So right now, anybody could just edit OIDC settings to their own provider and get in.

Okay, so. I finally managed to get onto Discord (it was very stubborn today) and there lelemm said that disabling the password is not possible because the API needs it and auto-login is not available yet.

@ilovepancakes95
Copy link

[...] it also is preventing the regular password login from being disabled.

Can you even disable the regular password? I'm Server Owner but I still have the option to use the password. And I don't see any settings for that either. I would guess that deactivating the password option is not a thing yet.

Hmm, I was under the impression that once a server owner is set after the first OIDC login happens that it disables regular password based access and goes into multi-user mode only. Maybe I misunderstood, and can't test because my install isn't properly setting server owner by itself anyway and getting rid of the ability to edit OIDC settings before login. So right now, anybody could just edit OIDC settings to their own provider and get in.

Okay, so. I finally managed to get onto Discord (it was very stubborn today) and there lelemm said that disabling the password is not possible because the API needs it and auto-login is not available yet.

OK if that is the case, then it seems the only downside to my situation is without a server owner being set, anyone coming upon the login page can now change the OIDC settings to their own provider and then login. Obviously this prevents me from "launching" using this yet, completely not secure.

@shall0pass
Copy link
Contributor

If you're referring to the link to change the OIDC settings on the login page, that link disappears once you login using openid.... at least it did for me.

I too would welcome an option (probably an environment option in the compose file that is easy to change before spinning up a container) to disable the web page password prompt. I do understand not totally locking it out for the API to continue to have access.

@ilovepancakes95
Copy link

If you're referring to the link to change the OIDC settings on the login page, that link disappears once you login using openid.... at least it did for me.

That is exactly what I mean. On my system, I get that prompt, I sign-in, but after I log out, the prompt is still there and I (or anyone else) can still change OIDC settings. And when I do login, under User Directory, my user (or any user) is not checked as "System Owner". Like whatever process that sets the system owner isn't working.

Hoping there is an easy quick fix.

@lelemm
Copy link
Contributor

lelemm commented Jan 8, 2025

If you're referring to the link to change the OIDC settings on the login page, that link disappears once you login using openid.... at least it did for me.

That is exactly what I mean. On my system, I get that prompt, I sign-in, but after I log out, the prompt is still there and I (or anyone else) can still change OIDC settings. And when I do login, under User Directory, my user (or any user) is not checked as "System Owner". Like whatever process that sets the system owner isn't working.

Hoping there is an easy quick fix.

you probably had an error but somehow the flow went until the end so you system owner was never created. I highly suggest you to disable openid and enable again to check for errors and to be sure the system owner is created

@ilovepancakes95
Copy link

you probably had an error but somehow the flow went until the end so you system owner was never created. I highly suggest you to disable openid and enable again to check for errors and to be sure the system owner is created

Think you are right. If I disable OIDC and then re-enable and go throw the flow from scratch I get {"status":"error","reason":"user-already-exists"} as the error in the web browser immediately after clicking "Sign In with Open ID".

@lelemm
Copy link
Contributor

lelemm commented Jan 9, 2025

you probably had an error but somehow the flow went until the end so you system owner was never created. I highly suggest you to disable openid and enable again to check for errors and to be sure the system owner is created

Think you are right. If I disable OIDC and then re-enable and go throw the flow from scratch I get {"status":"error","reason":"user-already-exists"} as the error in the web browser immediately after clicking "Sign In with Open ID".

I guess the username returned by the provider is empty string.
because there is a empty username string in the server (the fallback server password user has empty username)

@hendrik1120
Copy link

I have updated my initial bug report with additional information for troubleshooting. I still believe this a bug in the actualbudget oidc client.

@nicedevil007
Copy link
Contributor

hey guys, just a small thing for you => authentik is written with a lowercase "a". Can you change this on the dropdown menu for the openID provider? I'm already on my PR for the documentation of authentik's official page and the guys that are reviewing my PR already told this to me :)

goauthentik/authentik#12590 (comment)

I mean this part here during the configuration:
image

@tugdualenligne
Copy link

I there, just wanted to say thanks!
And that OpenID set-up worked fine for me using Authentik 24.12.2
It should be precised though, that the Redirect URI should be https://actual.domain.tld/openid/callback
And that you cannot chose as an Encryption key the "Authentik self-signed certificate" as it doesn't work if you do

@savely-krasovsky
Copy link

savely-krasovsky commented Jan 12, 2025

Configured with Casdoor, works without any issues for me.

@ajfurber
Copy link

Just want to say thank you to all who were involved with developing this, seriously useful now that partner and I can share a single budget.

Just to add, due to issues with Entra / Azure AD using the Display Name (rather than the UPN or username), I've configured with Cloudflare Access OIDC as the IDP and it works perfectly!

Thanks Again!

@marouamghar
Copy link

Hey, just to add, it works great in my setup using the config workaround with Authelia.

However, I tried to disable all but opened using allowedLoginMethods in the config file, but it's not picked/applied. I can still login with either the password or openid. Is that behaviour wanted, at least for the experimental phase?

@bobokun
Copy link

bobokun commented Jan 16, 2025

Not sure if you're aware but it could be something related to the openID/multi-user integration that was introduced caused header auth to be broken in v25.1.0

@NateMcKenzie
Copy link

This is a great feature! My brother and I have self-hosted individual instances of Actual so that we can each have separate budgets. That's not a huge deal, but it is nice to just have one instance. This feature almost gets us there, but it seems like there is only one SimpleFIN token for the whole instsance, so we couldn't use separate SimpleFIN accounts. Is this correct? Are there any plans to say let each user have their own token?

@helloWorld44-89
Copy link

helloWorld44-89 commented Jan 19, 2025

I have a similar issue as OP. I am using authentik and my account work as intended. I then tried to login as my wife’s account and got {"status":"error","reason":"openid-grant-failed"}. I checked and no user was created for the login.

Logs for actual budget server:
2025-01-18T23:35:50.199Z info: GET 200 /admin/owner-created/
2025-01-18T23:35:57.068Z info: GET 200 /account/needs-bootstrap
2025-01-18T23:35:57.097Z info: GET 200 /account/needs-bootstrap
2025-01-18T23:35:57.117Z info: GET 200 /account/needs-bootstrap
2025-01-18T23:35:57.158Z info: GET 200 /admin/owner-created/
Logging in via openid
2025-01-18T23:36:00.111Z info: POST 200 /account/login
2025-01-18T23:36:02.549Z info: GET 400 /openid/callback?code=4bec1426c3664e20977da978e750e693&state=HH-1bO-teG2MRKTXeiSSXvKv2y5vDgf40veduVCio8M
Logging in via openid
2025-01-18T23:41:47.867Z info: POST 200 /account/login
2025-01-18T23:41:50.388Z info: GET 400 /openid/callback?code=97bb298a0ccb45c3bd9006993019f9ab&state=azBkGiaWgKUnmJxdH5udZHMew37xpWm0ayHwOTZPzfo

UPDATE: I solved the issue. I had to create the user in Actual prior to them logging in.

Will the open id not create the new user?

@jfdoming jfdoming pinned this issue Jan 19, 2025
@RubenOlsen
Copy link
Member

RubenOlsen commented Jan 19, 2025

On the UX side of the Enable OpenID dialog box I believe we should add a sentence saying that people must export their data before continuing. I am aware that there are no technical reason for this, but it's all about 1) making people feel safe; 2) reducing the number of potential support request on the variant of I enabled OpenID - now my data is lost.

Image

@deathblade666
Copy link
Contributor

I have a similar issue as OP. I am using authentik and my account work as intended. I then tried to login as my wife’s account and got {"status":"error","reason":"openid-grant-failed"}. I checked and no user was created for the login.

Logs for actual budget server: 2025-01-18T23:35:50.199Z info: GET 200 /admin/owner-created/ 2025-01-18T23:35:57.068Z info: GET 200 /account/needs-bootstrap 2025-01-18T23:35:57.097Z info: GET 200 /account/needs-bootstrap 2025-01-18T23:35:57.117Z info: GET 200 /account/needs-bootstrap 2025-01-18T23:35:57.158Z info: GET 200 /admin/owner-created/ Logging in via openid 2025-01-18T23:36:00.111Z info: POST 200 /account/login 2025-01-18T23:36:02.549Z info: GET 400 /openid/callback?code=4bec1426c3664e20977da978e750e693&state=HH-1bO-teG2MRKTXeiSSXvKv2y5vDgf40veduVCio8M Logging in via openid 2025-01-18T23:41:47.867Z info: POST 200 /account/login 2025-01-18T23:41:50.388Z info: GET 400 /openid/callback?code=97bb298a0ccb45c3bd9006993019f9ab&state=azBkGiaWgKUnmJxdH5udZHMew37xpWm0ayHwOTZPzfo

UPDATE: I solved the issue. I had to create the user in Actual prior to them logging in.

Will the open id not create the new user?

OpenID at this time does not create the user accounts within actual so they need to be created manually

@deathblade666
Copy link
Contributor

On the UX side of the Enable OpenID dialog box I believe we should add a sentence saying that people must export their data before continuing. I am aware that there are no technical reason for this, but it's all about 1) making people feel safe; 2) reducing the number of potential support request on the variant of I enabled OpenID - now my data is lost.

Image

on that thought, why wouldn't we have it for every experimental feature? and could even go a step further to create a flow that steps people through backing up their data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental feature Related to an experimental feature feedback Single feedback thread for bug reports on a new feature
Projects
None yet
Development

No branches or pull requests