github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/doc/module/oauth.md (about)

     1  <!--- Content managed by Project Forge, see [projectforge.md] for details. -->
     2  # OAuth
     3  
     4  This is a module for [Project Forge](https://projectforge.dev). It provides logins and session management for many OAuth providers.
     5  
     6  https://github.com/kyleu/projectforge/tree/master/module/oauth
     7  
     8  ### License
     9  
    10  Licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0)
    11  
    12  ### Usage
    13  
    14  - Provides OAuth sessions for the web UI
    15  - By default, your project doesn't require any permissions or OAuth
    16  - To enable OAuth, set environment variables as described in the setup page at `/admin/settings`
    17  - To enable permissions, add the following code to your `appInit` function:
    18  
    19  ```go
    20  // The first parameter indicates if all actions should be allowed by default
    21  user.SetPermissions(false,
    22      user.Perm("/admin", "github:projectforge.dev", true), // grant admin access to users signed into GitHub with an email domain ending in projectforge.dev
    23      user.Perm("/admin", "*", false), // deny other users access to admin
    24      user.Perm("/", "*", true), // allow all other traffic
    25  )
    26  ```