use of net.runelite.http.api.account.OAuthResponse in project runelite by runelite.
the class SessionManager method login.
public void login() {
final OAuthResponse login;
try {
login = loginClient.login();
} catch (IOException ex) {
log.warn("Unable to get oauth url", ex);
return;
}
// Create new session
openSession(new AccountSession(login.getUid(), Instant.now()));
// Navigate to login link
LinkBrowser.browse(login.getOauthUrl());
}
use of net.runelite.http.api.account.OAuthResponse in project runelite by runelite.
the class AccountService method login.
@RequestMapping("/login")
public OAuthResponse login() {
UUID uuid = UUID.randomUUID();
State state = new State();
state.setUuid(uuid);
state.setApiVersion(RuneLiteAPI.getVersion());
OAuth20Service service = new ServiceBuilder().apiKey(oauthClientId).apiSecret(oauthClientSecret).scope(SCOPE).callback(RL_OAUTH_URL).state(gson.toJson(state)).build(GoogleApi20.instance());
String authorizationUrl = service.getAuthorizationUrl();
OAuthResponse lr = new OAuthResponse();
lr.setOauthUrl(authorizationUrl);
lr.setUid(uuid);
return lr;
}
Aggregations