write basic OAuth driver

This commit is contained in:
2026-08-04 21:09:46 -04:00
parent 8a8ebcdeec
commit c37a433984
2 changed files with 30 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package auth
import (
"golang.org/x/oauth2"
)
var oauthConfigs []oauth2.Config
func CreateTestOAuth() {
oauthEndpoint := oauth2.Endpoint{
AuthURL: "https://account.astraltech.xyz/application/o/authorize/",
TokenURL: "https://account.astraltech.xyz/application/o/token/",
}
oauthConfig := oauth2.Config{
ClientID: "stalwart-webui",
Scopes: []string{"user:email", "read:user"},
Endpoint: oauthEndpoint,
RedirectURL: "http://localhost:8080/callback",
}
oauthConfigs = append(oauthConfigs, oauthConfig)
}
+8
View File
@@ -0,0 +1,8 @@
package auth
import "net/http"
// this is usually served at /callback
func OAuthCallback(w http.ResponseWriter, r *http.Request) {
}