Skip to content

Commit

Permalink
Use native auth flow instead of SPA flow
Browse files Browse the repository at this point in the history
Turns out, the SPA flow only grants a refresh token good for 24 hours.
I originally chose it because prompt: select_account wasn't working
under the native flow for me, but that appears to work now.

This should allow you to go much longer without signing in again.
  • Loading branch information
DJtheRedstoner committed Nov 5, 2023
1 parent 2eab0e3 commit dc6641f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class CodeOAuthProvider extends OAuthProvider {

private static final String REDIRECT_URI = "http://localhost:3000";
private static final String REDIRECT_URI = "http://127.0.0.1:3000";
private static final String OAUTH_URL = "https://login.live.com/oauth20_authorize.srf";
private static final String OAUTH_TOKEN_URL = "https://login.live.com/oauth20_token.srf";

Expand Down Expand Up @@ -68,7 +68,6 @@ private OAuthToken getAuthorizationToken(Map<String, String> extraParams) {
params.putAll(extraParams);

JsonObject res = new HttpBuilder<Map<String, String>, JsonObject>(OAUTH_TOKEN_URL)
.header("Origin", "http://localhost")
.body(Http::urlEncodedBody, params)
.responseHandler(Http::checkStatus)
.execute()
Expand Down

0 comments on commit dc6641f

Please sign in to comment.