oke disini saya ada project, yaitu oauth2-authorization-server & oauth2-authorization-client.
selaku sebagai komponen utama di OAuth2 yang bertanggung jawab untuk mengelola authentication & otorisasi.
untuk authorization client itu sendiri berupa client atau pihak yang ingin akses ke data pengguna atau resource server, atas izin pengguna dengan bantuan komponen OAuth2 (oauth2-authorization-server). tapi di project ini, resource-server saya gabung dengan project oauth2-authorization-client.
- oauth2-authorization-client url -> http://localhost:8081/oauth2/authorization/angular-client
- oauth2-authorization-server url -> http://localhost:10000/login
- oauth2-authorization-server oauth2 token -> http://localhost:10000/oauth2/token
- oauth2-authorization-server code flow -> http://localhost:10000/oauth2/authorize
- oauth2-authorization-server check validity jwt -> http://localhost:10000/oauth2/jwks
-
user ingin mengakes api ke authorization client (resource access)
http://localhost:8081/oauth2/authorization/angular-clientdari authorization client, akan diredirect, user ke halaman loginhttp://localhost:10000/login
-
proses login oauth2 (user input username & password) yang sudah terdaftar di database
-
dari oauth2 authorization server akan proses callback code untuk authorization client, untuk proses oauth2 token
http://localhost:8081/oauth2/code/angular-client?code=qegWqt16VjdF6r1HlsU9_o6LLrTZs6xjypx81bHRaSBSb_iYH1A7kYdBdnbuzhMQqd27Ex0AtzYEmP-nNo53tQYpi9yevfhWbyBw1jzHPYl2el8a1OMNJ9QCTVsbMnYJ&state=XvoIpYG5ewEOzyepmEIAjb0-yDZweckEHh7D1f-cF2s%3D
-
proses oauth2 token, untuk mendapatkan access token & refresh token
code yang sudah didapatkan di put di parameter -> x-www-form-urlencoded (code)

seperti pada gambar dibawah ini
-
proses get data dari authorization client (resource server) penyedia data
masukan access token di sisi header dengan format -> Authorization - Bearer
negative case jika token tidak dibawa di sisi header
bagi teman-teman yang ingin melihat detailnya, bisa lihat di youtube milik saya di url berikut ini -> https://www.youtube.com/watch?v=FeSOuDzqljI
