Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bartmika/osin-thirdparty-example
Example of a simple application which is powered by a third-party oAuth 2.0 server for it's authentication / authorization. Written in Golang.
https://github.com/bartmika/osin-thirdparty-example
golang-examples oauth2 oauth2-client
Last synced: 21 days ago
JSON representation
Example of a simple application which is powered by a third-party oAuth 2.0 server for it's authentication / authorization. Written in Golang.
- Host: GitHub
- URL: https://github.com/bartmika/osin-thirdparty-example
- Owner: bartmika
- License: unlicense
- Created: 2022-01-02T04:16:07.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T05:14:24.000Z (about 3 years ago)
- Last Synced: 2024-11-10T04:30:00.272Z (3 months ago)
- Topics: golang-examples, oauth2, oauth2-client
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go mod init github.com/bartmika/osin-thirdparty-example
go get github.com/spf13/cobra
go get github.com/openshift/osin
go get github.com/openshift/osincligo run main.go
browser: http://localhost:8001/
**Step 1:** In your [osin-example](http://github.com/bartmika/osin-example) project run:
```
go run main.go add_client --client_id=thirdparty \
--client_secret=pleasechange \
--redirect_uri=http://127.0.0.1:8001/appauth/code
```**Step 2:** In your [osin-thirdparty-example](https://github.com/bartmika/osin-thirdparty-example) project please run the following:
```
go run main.go serve --client_id=thirdparty \
--client_secret=pleasechange \
--redirect_uri=http://127.0.0.1:8001/appauth/code \
--authorize_uri=http://localhost:8000/authorize \
--token_url=http://localhost:8000/token```
**Step 3:** In your browser, go to [http://127.0.0.1:8001](http://127.0.0.1:8001). Click the `Login` link and you will be redirected to the `osin` auth server. Fill in your credentials that you created previously and then you will be taken to the success page.