-
Notifications
You must be signed in to change notification settings - Fork 6
Sample OAuth2
LordVader edited this page May 20, 2021
·
8 revisions
NUGU SDK for Linux는 python으로 작성된 Web 기반의 OAuth2 client sample을 제공하고 있습니다.
이 sample은 libnugu-examples
패키지 안에 포함되어 있습니다.
웹브라우저를 통해 http://localhost:8080 주소로 접속하면 아래와 같이 OAuth2 인증을 위한 샘플 화면이 나타납니다.
인증을 위해 미리 발급받은 client_id
, client_secret
을 입력하고, 테스트 디바이스 구분을 위해 device serial
에 중복되지 않는 임의의 값(예: my_device_1234
) 입력 후 Save 버튼을 눌러 저장합니다.
이제 Get OAuth2 token 링크를 눌러 인증을 진행하면, 아래와 같이 최종적으로 access_token을 얻을 수 있습니다.
- 현재 Authorization Code, Client Credentials 2가지 방식의 인증을 지원하며 별도의 제휴절차 없는 체험판 사용시, Client Credentials 방식을 사용할 수 있습니다.
위 정보들은 /var/lib/nugu/nugu-auth.json
파일에 아래와 같은 JSON 형태로 저장됩니다.
{
"access_token" : "...",
"expires_at" : "...",
"expires_in" : "...",
"jti" : "...",
"refresh_token" : "...",
"scope" : "...",
"token_type" : "Bearer"
}
Contents
Contributions
External links