From 48a4ef2fec732fb534b53f5b67c1145debf2e916 Mon Sep 17 00:00:00 2001 From: Raul Calvo Date: Mon, 27 Nov 2017 13:19:15 +0100 Subject: [PATCH 1/3] - Showing web authentication in mobile. --- .../java/io/fullstack/oauth/OAuthManagerDialogFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java index 13e238f..4d38674 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java @@ -109,7 +109,7 @@ 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"); + mWebView.getSettings().setUserAgentString("Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0"); LayoutParams layoutParams = this.getFullscreenLayoutParams(context); From 0e595ef5ea15399af4997ee03e2817aea3597769 Mon Sep 17 00:00:00 2001 From: Raul Calvo Date: Mon, 27 Nov 2017 13:21:21 +0100 Subject: [PATCH 2/3] - Solved request more than one scope in google. --- .../fullstack/oauth/OAuthManagerProviders.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java index d91b4b5..2f9b5e1 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java @@ -264,23 +264,15 @@ private static ServiceBuilder _oauth2ServiceBuilder( String scopes = ""; if (cfg.containsKey("scopes")) { scopes = (String) cfg.get("scopes"); - String scopeStr = OAuthManagerProviders.getScopeString(scopes, ","); + String scopeStr = OAuthManagerProviders.getScopeString(scopes, " "); 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); @@ -296,7 +288,7 @@ private static String getScopeString( final String scopes, final String joinBy ) { - List array = Arrays.asList(scopes.replaceAll("\\s", "").split("[ ,]+")); + List array = Arrays.asList(scopes.replaceAll("\\s", "").split("[,]+")); Log.d(TAG, "array: " + array + " (" + array.size() + ") from " + scopes); return TextUtils.join(joinBy, array); } From 1ba963476d0935b525c5e8fe0e341058fb98064f Mon Sep 17 00:00:00 2001 From: Raul Calvo Date: Mon, 27 Nov 2017 13:25:48 +0100 Subject: [PATCH 3/3] - Fixed react native linking issue --- package.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/package.json b/package.json index 34a83b3..8212c5c 100644 --- a/package.json +++ b/package.json @@ -30,18 +30,6 @@ "react": "*", "react-native": "*" }, - "rnpm": { - "commands": { - "prelink": "node_modules/react-native-oauth/bin/prepare.sh", - "postlink": "node_modules/react-native-oauth/bin/cocoapods.sh" - }, - "ios": { - "project": "ios/OAuthManager.xcodeproj" - }, - "android": { - "packageInstance": "new OAuthManagerPackage()" - } - }, "dependencies": { "invariant": "^2.2.1", "valib": "^2.0.0"