mirror of
https://github.com/czp3009/bilibili-api.git
synced 2025-02-19 20:50:28 +08:00
尚不明确 B站 SSO API 的工作方式
This commit is contained in:
parent
4c4be210d7
commit
e7c79b7fe1
@ -22,7 +22,8 @@ public interface PassportService {
|
||||
@POST("api/oauth2/revoke")
|
||||
Call<LogoutResponseEntity> logout(@Query("access_token") String accessToken);
|
||||
|
||||
//TODO sso 未测试
|
||||
//TODO sso 尚不明确
|
||||
@Deprecated
|
||||
@GET("api/login/sso")
|
||||
Call sso(@Query("access_token") String accessToken);
|
||||
Call sso(@Query("access_token") String accessToken, @Query("gourl") String goUrl);
|
||||
}
|
||||
|
@ -15,7 +15,8 @@ import java.io.InputStreamReader;
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({
|
||||
UserInfoTest.class,
|
||||
LiveClientTest.class
|
||||
LiveClientTest.class,
|
||||
SsoTest.class
|
||||
})
|
||||
public class RuleSuite {
|
||||
@ClassRule
|
||||
|
25
src/test/java/com/hiczp/bilibili/api/test/SsoTest.java
Normal file
25
src/test/java/com/hiczp/bilibili/api/test/SsoTest.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hiczp.bilibili.api.test;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.hiczp.bilibili.api.BilibiliAPI;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SsoTest {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(UserInfoTest.class);
|
||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||
private static final BilibiliAPI BILIBILI_API = Config.getBilibiliAPI();
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
Object object = BILIBILI_API.getPassportService()
|
||||
.sso(BILIBILI_API.getBilibiliAccount().getAccessToken(), null)
|
||||
.execute()
|
||||
.body();
|
||||
LOGGER.info("{}", object.toString());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user