-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoauth.proto
62 lines (54 loc) · 1.51 KB
/
oauth.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// B站开放接口 - 账号授权 bilibili-webapp
syntax = "proto3";
package api.bilibili.com ;
import "google/api/annotations.proto";
option go_package = "github.com/dev-openapi/bilibili-webapp";
service OauthService {
// 获取AccessToken https://openhome.bilibili.com/doc/4/eaf0e2b5-bde9-b9a0-9be1-019bb455701c
rpc GetAccessToken(GetAccessTokenReq) returns (GetAccessTokenRes) {
option (google.api.http) = {
post: "/x/account-oauth2/v1/token",
};
};
// 刷新token https://openhome.bilibili.com/doc/4/eaf0e2b5-bde9-b9a0-9be1-019bb455701c
rpc RefreshToken(RefreshTokenReq) returns (RefreshTokenRes) {
option (google.api.http) = {
post: "/x/account-oauth2/v1/refresh_token",
};
};
}
message GetAccessTokenReq {
string client_id = 1;
string client_secret = 2;
string grant_type = 3;
string code = 4;
}
message GetAccessTokenRes {
message Data {
string access_token = 1;
int64 expires_in = 2;
string refresh_token = 3;
repeated string scopes = 4;
}
int32 code = 1;
string message = 2;
int32 ttl = 3;
Data data = 4;
}
message RefreshTokenReq {
string client_id = 1;
string client_secret = 2;
string grant_type = 3;
string refresh_token = 4;
}
message RefreshTokenRes {
message Data {
string refresh_token = 1;
string access_token = 2;
int64 expires_in = 3;
}
int32 code = 1;
string message = 2;
int32 ttl = 3;
Data data = 4;
}