Yet another... in progress...
+-----+ +-----+ +---------------+ | B | -- (1) protected resource ----> | | -- (4) authorization grant -> | authorization | | R | <- (2) unauthorized ----------- | A | <- (5) access token --------- | server | \O_ | O | -- (3) authorization ---------> | | +---------------+ | | W | | P | / \ | S | | | +---------------+ | E | <- (8) protected resource ----- | P | -- (6) access token --------> | resource | | R | | | <- (7) protected resource --- | server | +-----+ +-----+ +---------------+
- using java 14, build and run apps:
brew cask reinstall adoptopenjdk14 ./mvnw clean ; ./mvnw -pl :authorization-server,:app java -jar authorization-server/target/*.jar & java -jar app/target/*.jar &
- open in browser: http://127.0.0.1:8080
- click register
- you should be redirected with url: http://localhost:8081/oauth/authorize?grant_type=authorization_code&response_type=code&client_id=first-client
- authenticate with:
enduser
/enduserpassword
- you should be redirected on authorization page
- allow or deny...
- once allowed, click Authorize
- you should be redirected back to target page with authorization code present in a browser url
./mvnw clean package jib:docker
__
jdk14 ./mvnw -f step-1/step-1-authorization-server java -jar ./step-1/step-1-authorization-server/target/*.jar curl -sS first-client:noonewilleverguess@0:8081/oauth/token -d grant_type=client_credentials -d scope=any curl -sS first-client:noonewilleverguess@0:8081/oauth/token -d grant_type=password -d scope=any -d username=enduser -d password=enduserpassword
__
jdk14 ./mvnw -f step-0/step-0-authorization-server java -jar ./step-0/step-0-authorization-server/target/*.jar curl first-client:noonewilleverguess@localhost:8081/oauth/token -dgrant_type=client_credentials -dscope=any