79326847

Date: 2025-01-03 14:56:28
Score: 0.5
Natty:
Report link

Adding my implementation on top of baeldung's spring-auth-server examples by simply extending the authorization type to support spring extension grant type

Analogous to your requirement:

  1. First provider to authenticate clients with grant type AUTHORIZATION_CODE --> will be taken care by Form Login OIDC flow.

enter image description here

  1. Second provider for devices only with API access for devices grant type CLIENT_CREDENTIALS --> will be handled by extension grant type

enter image description here

curl --location 'http://127.0.0.1:9000/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic YXJ0aWNsZXMtY2xpZW50OnNlY3JldA==' \
--header 'Cookie: JSESSIONID=86898AB2DB4AF13A884E2321B681876A' \
--data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:custom_code' \
--data-urlencode 'code=7QR49T1W3'

I'm hoping that these will give some path to proceed you to the next level. Added the code commit here for your reference

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mohamed Faruk