Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
mWebView.setVisibility(View.VISIBLE);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setUserAgentString("Mozilla/5.0 Google");


LayoutParams layoutParams = this.getFullscreenLayoutParams(context);
Expand Down Expand Up @@ -172,7 +171,7 @@ private LayoutParams getFullscreenLayoutParams(Context context) {
realHeight = display.getHeight();
}

return new LayoutParams(realWidth, realHeight-convertDpToPixel(50f,context));
return new LayoutParams(realWidth, realHeight);
}


Expand Down
23 changes: 9 additions & 14 deletions android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,12 @@ private WritableMap accessTokenResponse(
resp.putString("status", "ok");
resp.putBoolean("authorized", true);
resp.putString("provider", providerName);
String uuid = (String) accessTokenMap.get("user_id");

String uuid = accessToken.getParameter("user_id");
response.putString("uuid", uuid);
String oauthTokenSecret = (String) accessTokenMap.get("oauth_token_secret");
String oauthTokenSecret = (String) accessToken.getParameter("oauth_token_secret");

String tokenType = (String) accessTokenMap.get("token_type");
String tokenType = (String) accessToken.getParameter("token_type");
if (tokenType == null) {
tokenType = "Bearer";
}
Expand All @@ -440,7 +441,6 @@ private WritableMap accessTokenResponse(
credentials.putString("access_token", accessToken.getToken());
credentials.putString("access_token_secret", oauthTokenSecret);
credentials.putString("type", tokenType);
// credentials.putString("scope", accessToken.getScope());
credentials.putString("consumerKey", consumerKey);

response.putMap("credentials", credentials);
Expand All @@ -458,26 +458,21 @@ private WritableMap accessTokenResponse(
) {
WritableMap resp = Arguments.createMap();
WritableMap response = Arguments.createMap();
Map accessTokenMap = new Gson().fromJson(accessToken.getRawResponse(), Map.class);

resp.putString("status", "ok");
resp.putBoolean("authorized", true);
resp.putString("provider", providerName);
try {
String uuid = (String) accessTokenMap.get("user_id");
response.putString("uuid", uuid);
} catch (Exception ex) {
Log.e(TAG, "Exception while getting the access token");
ex.printStackTrace();
}

String uuid = accessToken.getParameter("user_id");
response.putString("uuid", uuid);

WritableMap credentials = Arguments.createMap();
Log.d(TAG, "Credential raw response: " + accessToken.getRawResponse());

credentials.putString("accessToken", accessToken.getAccessToken());
String authHeader;

String tokenType = (String) accessTokenMap.get("token_type");
String tokenType = accessToken.getTokenType();
if (tokenType == null) {
tokenType = "Bearer";
}
Expand All @@ -488,7 +483,7 @@ private WritableMap accessTokenResponse(
}

String clientID = (String) cfg.get("client_id");
String idToken = (String) accessTokenMap.get("id_token");
String idToken = accessToken.getParameter("id_token");

authHeader = tokenType + " " + accessToken.getAccessToken();
credentials.putString("authorizationHeader", authHeader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,11 @@ private static ServiceBuilder _oauth2ServiceBuilder(
builder.scope(scopeStr);
}

boolean rawScopes = (cfg.containsKey("rawScopes") && ((String)cfg.get("rawScopes")).equalsIgnoreCase("true"));

if (opts != null && opts.hasKey("scopes")) {
scopes = (String) opts.getString("scopes");
String scopeStr = null;

if (!rawScopes)
scopeStr = OAuthManagerProviders.getScopeString(scopes, ",");
else
scopeStr = scopes;

String scopeStr = OAuthManagerProviders.getScopeString(scopes, ",");
builder.scope(scopeStr);
}
}

if (callbackUrl != null) {
builder.callback(callbackUrl);
Expand Down