-
Notifications
You must be signed in to change notification settings - Fork 57
Add PocketID OIDC groups check #131
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
base: main
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
PR Summary
|
Greptile SummaryAdded OIDC groups verification for PocketID authentication. The schema and seed files correctly add the Critical Issues:
Implementation Logic:
Confidence Score: 0/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Frontend
participant AuthService
participant PocketID
participant Database
User->>Frontend: Click PocketID login
Frontend->>AuthService: oauth2Authorize(POCKETID)
AuthService->>Database: Get remnawave settings
Database-->>AuthService: Settings with allowedGroups
alt allowedGroups configured
AuthService->>AuthService: Add 'groups' to scopes
end
AuthService->>PocketID: Redirect to authorize with scopes
PocketID->>User: Show consent screen
User->>PocketID: Approve
PocketID-->>Frontend: Redirect with code
Frontend->>AuthService: oauth2Callback(code)
AuthService->>PocketID: Exchange code for tokens
PocketID-->>AuthService: ID token with claims
AuthService->>AuthService: Decode ID token
AuthService->>AuthService: Check remnawaveClaim
alt remnawaveClaim exists
AuthService-->>Frontend: Success + JWT
else Check allowed emails
AuthService->>AuthService: Check if email in allowedEmails
alt email allowed
AuthService-->>Frontend: Success + JWT
else Check allowed groups
AuthService->>AuthService: Extract groups from claims
AuthService->>AuthService: Check if any group in allowedGroups
alt group allowed
AuthService-->>Frontend: Success + JWT
else No match
AuthService-->>Frontend: Forbidden
end
end
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 3 comments
Description
This PR add support for OIDC Group verification during the authentication process for the PocketID provider.
Currently, access is restricted to users whose emails are explicitly listed in the panel or those who have a custom claim (remnawaveClaim). This change allows for a more standard OIDC flow by restricting access based on the
groupsclaim provided in the ID token.Frontend
Need to add new field + logic (what should be filled or field with mail/group) + I18N to support new fields.
Example configuration