Implement oidc client of sorts
This commit is contained in:
parent
1772e57ee8
commit
a750f646a9
7 changed files with 175 additions and 55 deletions
|
|
@ -60,6 +60,14 @@ type Config struct {
|
|||
NotesDir string
|
||||
LogAccess bool
|
||||
Production bool
|
||||
OIDC struct {
|
||||
ClientID string `toml:"client_id"`
|
||||
ClientSecret string `toml:"client_secret"`
|
||||
AuthURL string `toml:"auth_url"`
|
||||
TokenURL string `toml:"token_url"`
|
||||
RedirectURL string `toml:"redirect_url"`
|
||||
UserinfoURL string `toml:"userinfo_url"`
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -62,9 +62,15 @@
|
|||
</ul>
|
||||
</li>
|
||||
{{template "navLinks" .}}
|
||||
{{if eq .user "anon"}}
|
||||
<li>
|
||||
<a class="nav-link" href="/auth/oauth/login/">Login</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
<a class="nav-link" href="/logout/">Logout {{.user}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{template "navExtra" .}}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue