goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
13.72k stars 918 forks source link

Allow to increase expiry date for app password #12034

Open archont94 opened 1 week ago

archont94 commented 1 week ago

Is your feature request related to a problem? Please describe. Currently there is no way to increase default app password expiry date (30 minutes since creation), there is only option to increase expiry for token passwords. In some cases (i.e. when app doesn't support interactive OAuth2 like docker or poetry to authenticate to PyPi server) app password is the only way to authenticate to resource.

Describe the solution you'd like Add extra group and/or user attribute to increase app password expiry date similar to way its done for tokens, i.e. goauthentik.io/user/app-password-maximum-lifetime

Describe alternatives you've considered I don't see any alternative, as setting given app password to non-expiry one isn't a good solution.

Additional context There was similar issue https://github.com/goauthentik/authentik/issues/5881 but it seems like either it affected only token expiry date, or there is regression and now its not possible to adjust expiry for app passwords.

pacohope commented 16 hours ago

I'm running release 2024.10.1 and I can set long expiring app passwords. As an Admin, I found the user in Directory → Users. I choose Update User and then add this in the user's attributes (see screenshot below):

goauthentik.io/user/token-maximum-lifetime: days=365

Now that user can go to Settings → Tokens and App Passwords and create an app password that is valid for 365 days. I've attached screenshots to show what I did and the app password I generated. If this isn't exactly what you were trying, you should pust far clearer steps of what you did, what you expected, and what you saw.

Now, I am fairly novice at Authentik, and I don't know how to just make that user property have the same value for all users. But if you set it on the one user it seems to work for that user.

Screenshot 2024-11-25 at 09 14 03 Screenshot 2024-11-25 at 09 12 53
archont94 commented 15 hours ago

@pacohope Thanks, I was able to use it the way you showed. After some investigation I realized, that the problem was different setting for one of groups to which user was assigned.

The only annoying thing which left is that by default app expiry date is set to 30 minutes in future, instead of maximum allowed value for given user. It would be great if this would be either configurable, or calculated based on user/groups settings for logged user. image