wuman / android-oauth-client Goto Github PK
View Code? Open in Web Editor NEWAndroid OAuth Client (android-oauth-client) is a library that helps to easily add an OAuth flow to an existing Android application.
License: Apache License 2.0
Android OAuth Client (android-oauth-client) is a library that helps to easily add an OAuth flow to an existing Android application.
License: Apache License 2.0
We are implementing OAuth2 flow on android. Our own OAuths system uses custom URL to redirect from authorising page back to the app so that the app can get the authorization_token for exchanging access_token with the OAuth server. Therefore we return our custom url in getRedirectUri() of our AuthorizationUIController.
But It now throws:
java.lang.IllegalArgumentException: java.net.MalformedURLException: Unknown protocol: {our custom scheme}
I would like to ask how thie library exchange authorization_token for access_token and if it supports custom URL redirection?
I am a backend developer checking out some android oauth2 libraries. I want to know if this library supports the grant type "Resource owner credentials" as specified in OAuth specification. If not can anybody point me in the direction of the library that does?
Thanks.
If using compile 'com.wu-man:android-oauth-client:0.4.4'
or compile 'com.wu-man:android-oauth-client:+'
the build fails with Error:(14, 30) error: package com.wuman.android.auth does not exist
at all imports of com.wuman.... (ex: import com.wuman.android.auth.AuthorizationFlow;
)
Using 0.4.3 explicitly fixes the issue, so this looks to be a regression in 0.4.4
Hi, project does not build after adding library via Gradle.
Stacktrace.. if it helps..
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.IllegalArgumentException: expected one element but was: <android.support.v4.app.FragmentActivity, android.support.v4.app.TaskStackBuilder.SupportParentable>
at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:317)
at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:329)
at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:302)
at dagger.shaded.auto.common.MoreTypes.nonObjectSuperclass(MoreTypes.java:722)
at dagger.internal.codegen.MembersInjectionBinding$Factory.forInjectedType(MembersInjectionBinding.java:224)
at dagger.internal.codegen.InjectBindingRegistry.getOrFindMembersInjectionBinding(InjectBindingRegistry.java:261)
at dagger.internal.codegen.BindingGraph$Factory$RequestResolver.rollUpMembersInjectionBindings(BindingGraph.java:374)
at dagger.internal.codegen.BindingGraph$Factory$RequestResolver.rollUpMembersInjectionBindings(BindingGraph.java:378)
at dagger.internal.codegen.BindingGraph$Factory$RequestResolver.rollUpMembersInjectionBindings(BindingGraph.java:378)
at dagger.internal.codegen.BindingGraph$Factory$RequestResolver.rollUpMembersInjectionBindings(BindingGraph.java:378)
at dagger.internal.codegen.BindingGraph$Factory$RequestResolver.lookUpBindings(BindingGraph.java:366)
at dagger.internal.codegen.BindingGraph$Factory$RequestResolver.resolve(BindingGraph.java:461)
at dagger.internal.codegen.BindingGraph$Factory.create(BindingGraph.java:228)
at dagger.internal.codegen.BindingGraph$Factory.create(BindingGraph.java:151)
at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:76)
at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:228)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
etc..
Note : Did not try to inject anything. i've just add gradle dependency and proguard rules.
Best regards
I am getting the following error:
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
I believe this is a conflict with the AppCompat (using v21.0.3). When I remove it, it works.
How to refresh a token , i dont know please help me to get new token.
i am integrating to uber.
the below code working fine.
My code:
SharedPreferencesCredentialStore credentialStore =
new SharedPreferencesCredentialStore(this,
"preferenceFileName", new JacksonFactory());
AuthorizationFlow.Builder builder = new AuthorizationFlow.Builder(
BearerToken.authorizationHeaderAccessMethod(),
AndroidHttp.newCompatibleTransport(),
new JacksonFactory(),
new GenericUrl("https://login.uber.com/oauth/token"),
new ClientParametersAuthentication("ADQjXcw8g7IG2d_wS2Yb0k0KA9YwKvYS",
"7R3GUDd-wW4Obtis9fKNkhvYL6t9Mz9hb3Z5Je5w"),
"ADQjXcw8g7IG2d_wS2Yb0k0KA9YwKvYS",
"https://login.uber.com/oauth/authorize");
builder.setCredentialStore(credentialStore);
ArrayList<String> scopes = new ArrayList<>();
scopes.add("profile");
scopes.add("places");
// scopes.add("request");
builder.setScopes(scopes);
AuthorizationFlow flow = builder.build();
AuthorizationUIController controller =
new DialogFragmentController(getFragmentManager()) {
@Override
public String getRedirectUri() throws IOException {
return "https://grabbngo";
}
@Override
public boolean isJavascriptEnabledForWebView() {
return false;
}
@Override
public boolean disableWebViewCache() {
return false;
}
@Override
public boolean removePreviousCookie() {
return false;
}
};
OAuthManager oauth = new OAuthManager(flow, controller);
OAuthManager.OAuthCallback<Credential> callback = new OAuthManager.OAuthCallback<Credential>() {
@Override
public void run(OAuthManager.OAuthFuture<Credential> future) {
try {
Credential credential = future.getResult();
//credential.getRefreshToken();
getUberStuff(credential.getAccessToken());
} catch (Exception e) {
e.printStackTrace();
}
}
};
oauth.authorizeImplicitly("userId", callback, new Handler());
}
void getUberStuff(final String token) throws AuthFailureError {
StringRequest stringRequest = new StringRequest(Request.Method.GET, "https://api.uber.com/v1/me",
new Response.Listener() {
@OverRide
public void onResponse(String response) {
Log.wtf("uresp", response);
try {
JSONObject jo = new JSONObject(response);
String img = jo.getString("picture");
String fname = jo.getString("first_name");
String lname = jo.getString("last_name");
String uuid = jo.getString("uuid");
String rider_id = jo.getString("rider_id");
String email = jo.getString("email");
prefs.edit().putString("lid", rider_id).putString("profileimg", img).putString("email", email).
putString("fname", fname).putString("lname", lname).
putString("token", token).
putString("source", "uber").commit();
startActivity(new Intent(Step1Activity.this, Step2Activity.class));
Step1Activity.this.finish();
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.wtf("uerr", error.toString());
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<>();
params.put("Authorization", "bearer " + token);
return params;
}
};
MyApp.q.add(stringRequest);
}
I'm basing an app I'm writing off of the Foursquare example, and yet when I run the samples app and attempt to click on the Explicit (foursquare) choice, I get the following:
07-20 11:34:57.749 4619-4619/com.wuman.oauth.samples E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.wuman.oauth.samples, PID: 4619
java.lang.IllegalArgumentException: Object returned from onCreateLoader must not be a non-static inner member class: GetTokenLoader{13750ad7 id=0}
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.start(LoaderManager.java:257)
at android.support.v4.app.LoaderManagerImpl.installLoader(LoaderManager.java:513)
at android.support.v4.app.LoaderManagerImpl.createAndInstallLoader(LoaderManager.java:500)
at android.support.v4.app.LoaderManagerImpl.initLoader(LoaderManager.java:553)
at com.wuman.oauth.samples.foursquare.SimpleOAuth2ExplicitActivity$OAuthFragment$1.onClick(SimpleOAuth2ExplicitActivity.java:124)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
It bombs out here.
Any insight?
I'm using this library to access oAuth 1.0 authenticated xero API, it's working fine in GET request so I'm able to get user's data. But it's not working with POST request so I'm unable to update anything it's always throwing 400 bad request but same request working with postman.
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.kelltontech.aibconnectorapp.presenter.syncing.SyncPresenter$1.doInBackground(SyncPresenter.java:52)
at com.kelltontech.aibconnectorapp.presenter.syncing.SyncPresenter$1.doInBackground(SyncPresenter.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
On attempting to sync 0.1.0 or 0.2.0 over gradle in Android Studio, I get an error that the android-oauth-client "uses libraries when it is not a library itself". Sync works fine on the earlier version of 0.0.3 I am attempting to grab a later version to get fullscreen support for the dialog.
The methods:
in DialogFragmentController will all throw a CancellationException if a user presses back when the authorization dialog is open, which is prone to happen. I suggest removing it or making it throw another exception. The fastest way is to just throw another IOException, which is already present in the code, and let users either ignore it or take action upon it.
Lint gave me the following error:
../../../../../.gradle/caches/modules-2/files-2.1/com.google.oauth-client/google-oauth-client-java6/1.15.0-rc/43f887355f67498501ff3d139c0bc53591244520/google-oauth-client-java6-1.15.0-rc.jar: Invalid package reference in library; not included in Android: java.awt. Referenced from com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp.
I'm assuming this error can be supressed?
This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.
Im guessing this class isnt used in your project.
wv.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { WebView wv = (WebView) v; if (keyCode == KeyEvent.KEYCODE_BACK && wv.canGoBack()) { wv.goBack(); return true; } return false; } });
This code causes the back key event performs twice in com.wuman.android.auth.OAuthDialogFragment
The server supports few claims, how can i added claims to the token request url.
In 0.1.0 it was removed for full screen (great!) then in 0.2.0 it was added back in. This shouldn't be a hard coded state, it should be a constructor argument whether to include the bar.
Hi,
in above URL , client id and secret are public , I suggest using grade or some other ways to hide client secret from public.
I have to load one fragment or another depending on the current authentication. Is it possible to check if you are already authenticated?
I'm using the OAuth implicit flow
First off, thanks for the lib, it seems like exactly what I need. Onto my issue...
I'm a bit new to gradle, trying to figure out how to use this project.
I see the latest version in the [Maven Repo](http://search.maven.org/#search|gav|1|g:"com.wu-man" AND a:"android-oauth-client") is 0.4.5
, and the samples require a version newer than 0.0.3
.
When I tried to plug in compile 'com.wu-man:android-oauth-client:0.4.5'
into my dependencies block I got an error saying that the lib depends on libraries but is a jar
. Not sure exactly what this means, but after looking around on the internet I got the tip to append @aar
to the end, so compile 'com.wu-man:android-oauth-client:0.4.5@aar'
which seemed to work.
But then my further com.google.api.client
imports no longer worked. I'm assuming that installing the aar
version doesn't include dependencies or something? I'm working towards it.
Right now if you only specify a dependency on:
com.wu-man android-oauth-client 0.0.1you have to include other dependencies to get the JacksonFactory class to be available.
Webview can't load auth url in dialogFragment.
Webview could work in dialog or activity.
Too many errors showing up while importing. Am i doing something wrong. (I am using the latest android adt with lates eclipse)
According to Google, It is strongly recommended that we do not use OAuth with WebView.
https://developers.google.com/identity/protocols/OAuth2InstalledApp
Is there any plan to update and allow System Browser along with WebView or atleast an option to handle it by developer. Currently the library forces the WebView.
@Override
public AuthorizationCodeTokenRequest newTokenRequest(String authorizationCode) {
return new LenientAuthorizationCodeTokenRequest(getTransport(), getJsonFactory(),
new GenericUrl(getTokenServerEncodedUrl()), authorizationCode)
.setClientAuthentication(getClientAuthentication())
.setScopes(getScopes())
.setRequestInitializer(
new HttpRequestInitializer() {
@Override
public void initialize(HttpRequest request) throws IOException {
//NullPointerException If do not set the "Request Initializer"
getRequestInitializer().initialize(request);
request.getHeaders().setAccept("application/json");
}
});
}
title
Is there an easy way to manage both connections? Does anybody knows which ones are the right parameters to set for doing a proper connection?
Is there support for the resource owner password OAuth 2 flow?
There is a bug in com.wuman.android.auth.AuthorizationFlow that causes the wrong expiry time value to be stored when using the implicit authorization flow.
In createAndStoreCredential(ImplicitResponseUrl, String)
on line 323:
.setExpirationTimeMilliseconds(implicitResponse.getExpiresInSeconds())
This should actually be:
.setExpiresInSeconds(implicitResponse.getExpiresInSeconds())
Could not find method com.google.api.client.auth.oauth2.AuthorizationCodeFlow$Builder.setScopes,
referenced from method com.wuman.android.auth.AuthorizationFlow$Builder .setScopes
我用的google-api-client-1.17.0-rc 我看了AuthorizationCodeFlow.java
只有一个 setScopes 方法
AuthorizationFlow 中的 的 Builder 重载了它三个 setScopes 方法, 是不是新版本里去掉了某些方法
It would be nice to just have the default DialogFragmentController be able to accept a title (preferably in the constructor) rather than override the onPrepareDialog method to set it. I also think that if no title is specified the title bar of the dialog should be removed.
Users should add tools:replace="android:allowBackup" to the application in the manifest.
There is an issue with your library caused by using an API that does not correspond to your level.
FragmentManagerCompat L. 35-41
boolean isDestroyed() {
if (supportFragmentManager != null) {
return supportFragmentManager.isDestroyed();
} else {
return nativeFragmentManager.isDestroyed(); // API 17+
}
}
Here is the documentation: http://developer.android.com/reference/android/app/FragmentManager.html#isDestroyed()
The crash was introduced by the latest PR.
Hope you find it useful and fix it soon,
Thank you.
How to use this library for 2-legged flow? It seems to me it requires all the links for 3-legged flow and also does the 3-legged procedure in backgraound.
After adding:
com.wu-man
android-oauth-client
0.0.2
I get a "Conversion to Dalvik format failed with error 1". Any suggestions?
In OAuthManager class, the doc comments for the authorization method says that the user id can be null if not using a persisted credential store, but in code it is validated to be not null.
Right now if I set my redirect uri to 'urn:ietf:wg:oauth:2.0:oob', I can never receive a token due to the logic in OAuthDialogFragment#interceptUrlCompat. It would be nice in the AuthorizationFlow.Builder class to add a callback url and use that url in the interceptUrlCompat class instead of the redirect uri.
Hi,
With the current version (0.4.5), I get a nullpointer:
05-02 15:31:11.084 19604-19604/com.shoutbox_app.shoutboxapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.shoutbox_app.shoutboxapp, PID: 19604
java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.api.client.http.HttpRequestInitializer.initialize(com.google.api.client.http.HttpRequest)' on a null object reference
at com.wuman.android.auth.AuthorizationFlow$1.initialize(AuthorizationFlow.java:229)
at com.wuman.android.auth.oauth2.explicit.LenientAuthorizationCodeTokenRequest$1.initialize(LenientAuthorizationCodeTokenRequest.java:142)
at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
at com.google.api.client.http.HttpRequestFactory.buildPostRequest(HttpRequestFactory.java:133)
at com.wuman.android.auth.oauth2.explicit.LenientAuthorizationCodeTokenRequest.executeLeniently(LenientAuthorizationCodeTokenRequest.java:158)
at com.wuman.android.auth.oauth2.explicit.LenientAuthorizationCodeTokenRequest.execute(LenientAuthorizationCodeTokenRequest.java:104)
at com.wuman.android.auth.OAuthManager$3.doWork(OAuthManager.java:206)
at com.wuman.android.auth.OAuthManager$BaseFutureTask.startTask(OAuthManager.java:420)
at com.wuman.android.auth.OAuthManager$Future2Task.start(OAuthManager.java:443)
at com.wuman.android.auth.OAuthManager$5.run(OAuthManager.java:399)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
The cause seems to be coming from this commit: 13bb765 I downgraded to 0.4.3, and afterwards it doesn't crash anymore.
I fetch my oauth access_token via a normal http POST call. Is it possible to set the values of the framework after this? From what I can see mFlow is private and there are not public methods that help me.
It would be nice to know before using the OAuthManager whether or not a valid Credential exists for a given user. Of course you could load the credential with the load(String userId, Credential credential) method and do the same logic test for determining it's validity within OAuthManager's authorize methods, but it would be nice to have this functionality within the library itself. Something like:
SharedPreferencesCredentialStore credentialStore = new SharedPreferencesCredentialStore(this, "credentialStore", new JacksonFactory());
boolean authorized = credentialStore.isAuthorized("userId");
The LinkedIn app registration page insists on an absolute, https redirect (see also docs).
How can I use this in my own app? http://localhost/Callback
cannot be used? (I'm trying to reuse the library
part.)
See also http://stackoverflow.com/questions/22062145/oauth-2-0-authorization-for-linkedin-in-android
This should only be declared in the app -- it's actually giving me an error on my build when I include the library (even when I try to exclude it using tools:replace="android:allowBackup"
Hi, first of all thank you for putting effort to simplify the Oauth flow mess. i have noticed 2 issues at this moment.
i dont know why but i cant run the example, maven doesn't create all the dependencies because there is an errore in pom file
ERROR:
Project build error: Non-resolvable parent POM: Could not find artifact com.wuman:android-oauth-client-parent:pom:0.0.3-SNAPSHOT and 'parent.relativePath' points at wrong local POM
BLOCK:
com.wuman
android-oauth-client-parent
0.0.3-SNAPSHOT
../pom.xml
java.lang.ClassCastException: com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl cannot be cast to com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl
at com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl.set(AuthorizationCodeResponseUrl.java:222)
at com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl.set(AuthorizationCodeResponseUrl.java:58)
at com.google.api.client.http.UrlEncodedParser.parse(UrlEncodedParser.java:182)
at com.google.api.client.http.UrlEncodedParser.parse(UrlEncodedParser.java:96)
at com.google.api.client.http.GenericUrl.(GenericUrl.java:165)
at com.google.api.client.http.GenericUrl.(GenericUrl.java:126)
at com.google.api.client.http.GenericUrl.(GenericUrl.java:115)
at com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl.(AuthorizationCodeResponseUrl.java:99)
at com.wuman.android.auth.OAuthDialogFragment$3.interceptUrlCompat(OAuthDialogFragment.java:361)
at com.wuman.android.auth.OAuthDialogFragment$3.shouldOverrideUrlLoading(OAuthDialogFragment.java:316)
at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:73)
at yk.b(PG:89)
at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:172)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(PG:9)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Hello,
I would like to thank you for such a nice utility to abstract the complexities of oauth. I have a question on its implementation. This may not be a bug/feature and just a gap in my understanding. If so, please excuse me.
I am trying to use oauth2 authentication via Django's oauth2_provider. I am able to generate token and refresh token via curl.
curl -X POST -d "grant_type=password&username=user1&password=user1&client_secret=${ClientSecret}&client_id=${ClientId}" http://localhost:8000/o/token/
I have set authorization grant type as "resource owner password-based".
When I try to use android-oauth-client, I get a exception. As you can see, the url generated from android-oauth-client is a little different. Can you please point me to any issues in my approach?
900 2212-2212/com.sanabhi.dropboat W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
11-09 02:11:38.907 2212-2212/com.sanabhi.dropboat I/OAuthAndroid: onPageStarted: http://localhost:8000/o/token/?client_id=rXBixkjnYvZf78HUm8Jw17fR2awHgV5nqGHfTAaE&redirect_uri=http://localhost:8000/o/authorize&response_type=token
11-09 02:11:38.907 2212-2212/com.sanabhi.dropboat I/OAuthAndroid: url: http://localhost:8000/o/token/?client_id=rXBixkjnYvZf78HUm8Jw17fR2awHgV5nqGHfTAaE&redirect_uri=http://localhost:8000/o/authorize&response_type=token, redirect: http://localhost:8000/o/authorize, callback: false
11-09 02:11:38.920 2212-9801/com.sanabhi.dropboat W/System.err: java.io.IOException: User authorization failed (net::ERR_CONNECTION_REFUSED)
11-09 02:11:38.920 2212-9801/com.sanabhi.dropboat W/System.err: at com.wuman.android.auth.DialogFragmentController.waitForImplicitResponseUrl(DialogFragmentController.java:189)
11-09 02:11:38.920 2212-9801/com.sanabhi.dropboat W/System.err: at com.wuman.android.auth.OAuthManager$4.doWork(OAuthManager.java:260)
11-09 02:11:38.920 2212-9801/com.sanabhi.dropboat W/System.err: at com.wuman.android.auth.OAuthManager$BaseFutureTask.startTask(OAuthManager.java:420)
11-09 02:11:38.920 2212-9801/com.sanabhi.dropboat W/System.err: at com.wuman.android.auth.OAuthManager$Future2Task.start(OAuthManager.java:443)
11-09 02:11:38.920 2212-9801/com.sanabhi.dropboat W/System.err: at com.wuman.android.auth.OAuthManager$5.run(OAuthManager.java:399)
11-09 02:11:38.921 2212-9801/com.sanabhi.dropboat W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
11-09 02:11:38.921 2212-9801/com.sanabhi.dropboat W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-09 02:11:38.921 2212-9801/com.sanabhi.dropboat W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
11-09 02:11:38.921 2212-9801/com.sanabhi.dropboat W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
11-09 02:11:38.921 2212-9801/com.sanabhi.dropboat W/System.err: at java.lang.Thread.run(Thread.java:818)
the compile dependency 0.0.3 is totally outdated, and I cannot import library/module as a module into another project.
and when attempting to build using the library AAR, I get the dreaded com.android.dex.DexException: Multiple dex files define Lorg/codehaus/jackson/Base64Variant;
getting this build error in gradle.
one work around is to force it to use the aar by putting
compile 'com.wu-man:android-oauth-client:0.4.4@aar' in the gradle dependecies
I have a spring based authorization server running on my pc with self signed certificate.
In this case I'm unable to connect to the authorization server.
I get the following exception:
I/X509Util: Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
I have created the following controller object with setting the webView's WebViewClient:
AuthorizationUIController controller = new DialogFragmentController(getFragmentManager(), true) {
@Override
public String getRedirectUri() throws IOException {
return REDIRECT_URI;
}
@Override
public boolean isJavascriptEnabledForWebView() {
return true;
}
@Override
public boolean disableWebViewCache() {
return false;
}
@Override
public boolean removePreviousCookie() {
return false;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View oauthLoginLayout = inflater.inflate(R.layout.oauth_login_layout, container, false);
WebView webView = (WebView) oauthLoginLayout.findViewById(android.R.id.primary);
if(webView != null) {
webView.setWebViewClient(new WebViewClient() {
public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
handler.proceed();
}
});
}
return oauthLoginLayout;
}
};
But this has no effect, because in OAuthDialogFragment's onViewCreated method, the webView's WebViewClient is being set, so my custom WebViewClient is never used.
There should be an option to enable self signed certificates for the webview for testing purposes.
i have downloaded the zip and tried to open the project using android studio. i got the above error.when i click on the open file, it was opening to the line "def lastGitTag = "git describe --tags HEAD".execute().text".
i thought the reason could be because i do not have git on my system. so i installed git and set the git.exe path in settings. but still i get the same error.
i do not know what the reason could be. i want to have a look at the samples by running the project in android studio. but i am not able to build the project. please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.