oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

how to implemente an entire user system based on go_oauth2?

Open wilsonlichina opened this issue 3 years ago • 1 comments

hello guys,

this project is very good, despite I know there are still many things I don't understand. you known, i want to implement an entire user system to process to user's register、login、authorization authentication restful apis etc. and put these restful apis into one project. my means my business is small, i don't have plan to split auth server and resource server. do you have any projects or examples for details?

wilsonlichina avatar May 01 '22 04:05 wilsonlichina

i was in the same boat as you but there is a lot of examples out there. For ex gin-server shows how to make a server that is both AS and RS: https://github.com/go-oauth2/gin-server/blob/master/examples/server.go in the test endpoint where it uses api.Use(ginserver.HandleTokenVerify()) to parse and validate the incoming token. Combine that with one of the store implementations listed in https://github.com/go-oauth2/oauth2#store-implements and you have a full implementation you can use for your project.

jarlandre avatar Jan 19 '23 10:01 jarlandre