https://github.com/tsingsun/go-oauth2
oauth2 in go
https://github.com/tsingsun/go-oauth2
Last synced: 2 months ago
JSON representation
oauth2 in go
- Host: GitHub
- URL: https://github.com/tsingsun/go-oauth2
- Owner: tsingsun
- Created: 2018-04-17T09:08:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-12T09:30:15.000Z (over 6 years ago)
- Last Synced: 2025-02-14T01:45:21.372Z (4 months ago)
- Language: Go
- Size: 58.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GO-OAUTH2
OAuth 2.0 server library for Golang.
## Install
## Get Start
### generate rsa key
go-oauth2 use rs256 for generate jwt token,it need rsa pair key
use bellow command in the openssl console
```openssl
//generate private key
genrsa -out rsa_auth.key 1024
//use pkcs8
pkcs8 -topk8 -in rsa_auth.key -out rsa_auth_pkcs8.pem -outform pem -nocrypt
//generate public key
rsa -in rsa_auth.key -pubout -out rsa_pub.pem -outform pem
```### generate encryption key
the internal payload data use aes encrypt,so you need generate a 32 length string
## test
if you change repository interface,rebuild the mock of repository interface
```
mockgen -source repository_interface.go -destination=mocks/mock_repository.go
```