https://github.com/parths049/spring-oauth2
https://github.com/parths049/spring-oauth2
java oauth2 spring spring-boot spring-security-oauth2
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/parths049/spring-oauth2
- Owner: parths049
- Created: 2019-10-03T09:33:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-20T18:32:51.000Z (almost 3 years ago)
- Last Synced: 2025-09-12T00:27:22.012Z (9 months ago)
- Topics: java, oauth2, spring, spring-boot, spring-security-oauth2
- Language: Java
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
* Create database in mysql :-
database name - poc
* Run spring boot project :-
open project folder in terminal > execute run command > clean install spring-boot:run
* Open swagger in browser with this below url and click on "Try it out" button for admin sign up in mysql database :-
http://localhost:8080/swagger-ui.html#!/account/adminSignUpUsingPOST
* Open postman for call oauth2 login api
select method > POST
paste this url > http://localhost:8080/oauth/token
In authorization select "Basic Auth" > username = client > password = secret
> after that click on right side button "Update Request"
> click on Body in title bar > select "x-www-form-urlencoded"
> key : value
username : adminstrator@poc.io
password : 123456
grant_type : password
> after that click on button "Send".
* So you can get "access_token" and "refresh_token" in that response.
* Now you can also login with using refresh_token in request. Follow below step to login with refresh_token.
select method > POST
paste this url > http://localhost:8080/oauth/token
In authorization select "Basic Auth" > username = client > password = secret
> after that click on right side button "Update Request"
> click on Body in title bar > select "x-www-form-urlencoded"
> key : value
grant_type : refresh_token
client_id : client
refresh_token : copy and paste refresh_token u get in above request.