-
Notifications
You must be signed in to change notification settings - Fork 32
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
Oauth APPs for users #8
Comments
You can refer to the use of redis storage: https://github.com/go-oauth2/redis package main
import (
"gopkg.in/go-oauth2/redis.v3"
"gopkg.in/oauth2.v3/manage"
)
func main() {
manager := manage.NewDefaultManager()
// use redis token store
manager.MapTokenStorage(redis.NewRedisStore(&redis.Options{
Addr: "127.0.0.1:6379",
DB: 15,
}))
} |
We have currently a struct like this, this allow a user to create a new application to allow them to leverage our api. In our legacy PHP application, ClientID and ClientSecret are generated for the user. type App struct {
ID uuid.UUID
Name string
Slug string
Description string
ClientID string
ClientSecret string
CallbackURL string
AppURL string
} |
https://github.com/vgarvardt/go-oauth2-pg for ex. But you can also just implement the interfaces yourself too. With your own database logic. e.g.
|
So I'm working on an authentication system for users. I want to allow my users to create OAuth apps sorta like how GitHub does it in their developer section. Where the user can create the application, with register they get the client id and client secret. So I have functionality that will generate a client id and client secret with refresh/ revoke. What I'm wondering is how to take your example and make it database driven. Could you provide some guidance ?
The text was updated successfully, but these errors were encountered: