Based on the https://github.com/go-oauth2/mongo
$ go get -u github.com/contamobi/go-oauth2-dynamodb
package main
import (
"github.com/contamobi/go-oauth2-dynamodb"
"github.com/contamobi/go-oauth2/manage"
)
func main() {
manager := manage.NewDefaultManager()
manager.MustTokenStorage(
dynamo.NewTokenStore(dynamo.NewConfig(
"us-east-1", // AWS Region
"http://localhost:8000", // AWS DynamoDB Endpoint
"AKIA*********", // AWS Access Key
"*************", // AWS Secret
"oauth2_basic", // Oauth2 basic table name
"oauth2_access", // Oauth2 access table name
"oauth2_refresh", // Oauth2 refresh table name
)),
)
// ...
}
package main
import (
"github.com/contamobi/go-oauth2-dynamodb"
"github.com/contamobi/go-oauth2/manage"
)
func main() {
manager := manage.NewDefaultManager()
manager.MustTokenStorage(
dynamo.NewTokenStore(dynamo.NewConfig(
"us-east-1", // AWS Region
"", // Emtpy
"", // Emtpy
"", // Emtpy
"oauth2_basic", // Oauth2 basic table name
"oauth2_access", // Oauth2 access table name
"oauth2_refresh", // Oauth2 refresh table name
)),
)
// ...
}
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
export AWS_REGION=us-east-1
export DYNAMODB_ENDPOINT='http://localhost:8000'
export AWS_ACCESS_KEY=AKIA******
export AWS_SECRET=**************
go test
Copyright (c) 2018 Conta.MOBI