Skip to content

muhamadnirwansyah/oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Penjelasan project

oke disini saya ada project, yaitu oauth2-authorization-server & oauth2-authorization-client.

oauth2-authorization-server

selaku sebagai komponen utama di OAuth2 yang bertanggung jawab untuk mengelola authentication & otorisasi.

oauth2-authorization-client

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.

Base url

  1. oauth2-authorization-client url -> http://localhost:8081/oauth2/authorization/angular-client
  2. oauth2-authorization-server url -> http://localhost:10000/login
  3. oauth2-authorization-server oauth2 token -> http://localhost:10000/oauth2/token
  4. oauth2-authorization-server code flow -> http://localhost:10000/oauth2/authorize
  5. oauth2-authorization-server check validity jwt -> http://localhost:10000/oauth2/jwks

Simulasi Hight Level Design

oauth2_authorization_server_client drawio

Capture Process by images

  1. user ingin mengakes api ke authorization client (resource access) http://localhost:8081/oauth2/authorization/angular-clientdari authorization client, akan diredirect, user ke halaman login http://localhost:10000/login

    image
  2. proses login oauth2 (user input username & password) yang sudah terdaftar di database

    image
  3. 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

image
  1. proses oauth2 token, untuk mendapatkan access token & refresh token

    code yang sudah didapatkan di put di parameter -> x-www-form-urlencoded (code)
    image

    seperti pada gambar dibawah ini

    image image image
  2. proses get data dari authorization client (resource server) penyedia data

    masukan access token di sisi header dengan format -> Authorization - Bearer

    image

    negative case jika token tidak dibawa di sisi header

    image

Penjelasan berdasarkan video

bagi teman-teman yang ingin melihat detailnya, bisa lihat di youtube milik saya di url berikut ini -> https://www.youtube.com/watch?v=FeSOuDzqljI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published