Comments (8)
If you point me in the right direction, I'll take a look at submitting a PR.
from wg-portal.
Suppose, there is no toggle because user is synced from external provider, in your case Authentik.
Try to use is_admin
property in oauth/oidc config.
But there is also bug - once user is created, permissions aren't updated on next login sync.
from wg-portal.
@bonddim I gave that a shot, but it's not working (I'm deleting the user in between sign ins; should be fresh is_admin
on each login).
auth:
callback_url_prefix: https://<my-url>/api/v0
oidc:
- id: authentik
provider_name: authentik
display_name: Login with Authentik
base_url: https://<my-authentik-url>/application/o/wireguard-portal/
client_id: my-client-id
client_secret: my-super-secret-client-secret
extra_scopes:
- profile
- email
- is_admin
field_map:
email: email
user_identifier: email
registration_enabled: true
I then have a Property Mapping with the scope is_admin
in my Authentik:
return str(ak_is_group_member(request.user, name="Administrators")).lower()
Here's the test output:
Not quite sure where I went wrong. For now I'll manually update in the DB.
from wg-portal.
Gave it a shot with oauth
and it leads to a 404 when I click the login button: https://<my-wgportal-url>/api/v0/api/v0/authentik-oauth/init
. When I correct the double URI issue, it still 404s.
from wg-portal.
@joestump ,
try to add is_admin: "true"
into field_map
from wg-portal.
@bonddim if I'm following the code correctly, that would result in true
being used for the field mapping? getOauthFieldMapping
would set true
as the key for looking up in ParseUserInfo
? Authentik doesn't appear to set admin_flag
by default and my extra scopes hack didn't work either.
from wg-portal.
@joestump,
Correct, wg-portal expects value parsable to boolean to set admin permissions.
By providing is_admin:
in field_map
you set to which property in token scope to look for admin role.
If your authentick adds extra scope is_admin: true
, it should work with
....
field_map:
is_admin: is_admin
...
from wg-portal.
@joestump did you manage to get it working?
from wg-portal.
Related Issues (20)
- [v2] Keypairs/PublicKey can not be changed HOT 3
- Deploy and run HOT 1
- Squashed PostUp / PostDown HOT 2
- wg-portal deletes routes HOT 4
- User management
- LDAP disable Peers deleted from ldap HOT 1
- Issue with Postgres database HOT 1
- Redirect traffic to domain HOT 1
- Option to bind webserver to specific interface HOT 1
- Customizing homepage HOT 1
- Instructions/example for `field_map`? HOT 6
- Docker container refuses to find/load config.yml when not mapped directly to the file
- Peers are added to wg0.conf with a mask of /24
- LDAP Login Issue HOT 6
- Doc: Showing prominently config format for current stable version HOT 2
- Error when using mysql as database
- LDAP sync runs every 10 seconds, ldap_sync_interval is ignored
- Sending Wireguard-Config via Postfix Mailserver Fails
- no work with ghcr.io/wg-easy/wg-easy:latest after update HOT 1
- [ Feature Request ] - v2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wg-portal.