0
내가 구글 서비스 계정을 생성하고erlang을 사용하여 Google OAuth 서비스 계정에 대한 JWT 서명을 계산 하시겠습니까?
JWT should be createdget access token에 private_key
, client_email
등이 포함 된 JSON 파일이 있습니다.
I 단계
다음 따랐다헤더 계산 :
Header = jsx:encode(#{<<"alg">> => <<"RS256">>,<<"typ">> => <<"JWT">>}).
Base64Header = base64:encode(Header).
주장 계산 : 우리가 SHA256withRSA를 사용하여 Input
의 UTF-8 표현을 가입 할 수 있습니다 방법
Claims = jsx:encode(#{
<<"iss">> => <<"[email protected]">>,
<<"scope">> => <<"https://www.googleapis.com/auth/cloud-platform">>,
<<"aud">> => <<"https://www.googleapis.com/oauth2/v4/token">>,
<<"exp">> => 1471629262,
<<"iat">> => 1471627282
}).
Base64Claims = base64:encode(Claims).
Input = {Base64Header}.{Base64Claim}
그리고, (SHA-256 해시 기능을 사용하는 RSASSA-PKCS1-V1_5-SIGN이라고도 함)에 private_key
을 입력하고 JWT 서명?