Skip to content

fbertos/spring-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


curl -X POST \
  http://localhost:8085/oauth/token \
  -H 'authorization: Basic c3ByaW5nLXNlY3VyaXR5LW9hdXRoMi1yZWFkLXdyaXRlLWNsaWVudDpzcHJpbmctc2VjdXJpdHktb2F1dGgyLXJlYWQtd3JpdGUtY2xpZW50LXBhc3N3b3JkMTIzNA==' \
  -F grant_type=password \
  -F username=admin \
  -F password=admin1234 \
  -F client_id=spring-security-oauth2-read-write-client



Authorization token is calculated as Base64Encoder(client_id:client_secret)
  Base64Encode("spring-security-oauth2-read-write-client:spring-security-oauth2-read-write-client-password1234")
 


curl -X GET \
  http://localhost:8085/users \
  -H 'authorization: Bearer afd9dce1-a24d-4606-ae52-08779ebbe4ae'

  
 
Client Details Password Encode (class Encoders method oauthClientPasswordEncoder)
  new BCryptPasswordEncoder(4).encode("spring-security-oauth2-read-write-client-password1234")

User Password Encode (class Encoders method userPasswordEncoder) 
  new BCryptPasswordEncoder(8).encode("admin1234")
  
  
spring-security-oauth2-read-write-client-password1234 => a$2a$04$.YUZLeD3/toTgCFrgixWYuxz8h6kcisWtrJJFWucKcii3sgRV5xei
admin1234 => $2a$08$.wdsqTvMznn76z8tq1J/gep7uqKd.bpI6gqJn9zTlRAeAWQucuX4q

  
update oauth_client_details set client_secret = '$2a$04$.YUZLeD3/toTgCFrgixWYuxz8h6kcisWtrJJFWucKcii3sgRV5xei' where client_id = 'spring-security-oauth2-read-client';
update USER_ set PASSWORD = '$2a$08$.wdsqTvMznn76z8tq1J/gep7uqKd.bpI6gqJn9zTlRAeAWQucuX4q' where ID = 1;
  

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages