본문 바로가기
Programming/Java * Spring

[Spring Boot] Authorization Server(feat. Postman)

by 고막고막 2019. 7. 10.

 

 

grant-type : 클라이언트 인증 방식 

 

 

AUTHENTICATION: BASIC base64Encode(clientId+ ':' + password)

Spring에서 지원하는 Oauth Structure

CREATE TABLE OAUTH_CLIENT_DETAILS (
 CLIENT_ID VARCHAR(255) PRIMARY KEY,
 RESOURCE_IDS VARCHAR(255),
 CLIENT_SECRET VARCHAR(255),
 SCOPE VARCHAR(255),
 AUTHORIZED_GRANT_TYPES VARCHAR(255),
 WEB_SERVER_REDIRECT_URI VARCHAR(255),
 AUTHORITIES VARCHAR(255),
 ACCESS_TOKEN_VALIDITY INTEGER,
 REFRESH_TOKEN_VALIDITY INTEGER,
 ADDITIONAL_INFORMATION VARCHAR(4096),
 AUTOAPPROVE VARCHAR(255)
);

CREATE TABLE OAUTH_CLIENT_TOKEN (
 TOKEN_ID VARCHAR(255),
 TOKEN BYTEA,
 AUTHENTICATION_ID VARCHAR(255) PRIMARY KEY,
 USER_NAME VARCHAR(255),
 CLIENT_ID VARCHAR(255)
);

CREATE TABLE OAUTH_ACCESS_TOKEN (
 TOKEN_ID VARCHAR(255),
 TOKEN BYTEA,
 AUTHENTICATION_ID VARCHAR(255) PRIMARY KEY,
 USER_NAME VARCHAR(255),
 CLIENT_ID VARCHAR(255),
 AUTHENTICATION BYTEA,
 REFRESH_TOKEN VARCHAR(255)
);

CREATE TABLE OAUTH_REFRESH_TOKEN (
 TOKEN_ID VARCHAR(255),
 TOKEN BYTEA,
 AUTHENTICATION BYTEA
);

CREATE TABLE OAUTH_CODE (
 CODE VARCHAR(255),
 AUTHENTICATION BYTEA
);

CREATE TABLE OAUTH_APPROVALS (
 USERID VARCHAR(255),
 CLIENTID VARCHAR(255),
 SCOPE VARCHAR(255),
 STATUS VARCHAR(10),
 EXPIRESAT TIMESTAMP,
 LASTMODIFIEDAT TIMESTAMP
);