oauth-io / oauth-android Goto Github PK
View Code? Open in Web Editor NEWOAuth.io library for android
License: Apache License 2.0
OAuth.io library for android
License: Apache License 2.0
I want to save some custom data for the stormpath user account. As explained in the docs, I have called saveIdentity() of OAuthUser class after setting some data as below:
OAuthUser user = users.getIdentity();
user.data.put("location", "Pune, India");
user.data.put("gender", "Male");
user.saveIdentity(new OAuthUserCallback() {
@Override
public void onFinished() {
}
@Override
public void onError(String message) {
}
});
When I looked inside the method definition, I have found that it does not call post rather it calls get() of OAuthJSONRequest class.
public void saveIdentity(final OAuthUserCallback callback) {
String url = _oauth.getOAuthdURL() + "/api/usermanagement/user?k=" + _oauth.getPublicKey() + "&token=" + token;
JSONObject postdata = new JSONObject();
try {
Iterator it = data.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
postdata.put(key, data.get(key));
}
} catch (JSONException e) {
callback.onError(e.getMessage());
return;
}
new OAuthJSONRequest().get(url, new OAuthJSONCallback() {
@Override
public void onFinished(JSONObject data) {
callback.onFinished();
}
@Override
public void onError(String message) {
callback.onError(message);
}
});
}
Link to StackOverflow question: http://stackoverflow.com/q/34082103/1567675
Can you please advise me? @bumpmann @thyb @william26
This Is How You Do It With JavaScript.
OAuth.popup(provider, {
state: oauthstate
}).done(handleOAuthAuthorization);
function handleOAuthAuthorization(result){
$.ajax({
url: 'index.php',
type: 'POST',
dataType: 'json',
data: {
code: result.code
}
}).done(function(r){
handleOAuthCallback(r);
});
}
What I'm Trying To Do With Android
OAuth o = new OAuth(this);
o.setOAuthdURL("https://andrew.easypparking.com:6284");
o.initialize("key");
JSONObject opts = new JSONObject();
JSONObject json = null;
try {
json = getPostJSON("https://andrew.easypparking.com/apps/mobile/oauth/index.php?resource=genstate");
opts.put("state", json.getString("oauthstate"));
} catch (JSONException e) {
e.printStackTrace();
}
try {
opts.put("oauthprovider", provider);
} catch (JSONException e) {
e.printStackTrace();
}
o.popup(provider, opts, CurrentCallbackActivity.this);
The methods for OAuth.popup are also different in the Jar than the source of this project. Seems like the example app uses classes from the package in io.oauth while the JAR has everything in a com.webshell.oauth.
The callback methods are also different. The webshell classes do actually work and return the token and token secret, but doesn't return the user_id or screen_name.
The example app uses the io.oauth package, and that seems to actually show some ways to get userdata (i.e. in a Twitter example, I need the Alias to get more data about the auth'ing user)
I'll JAR up the source files (io.auth package) and see if I can use that.
Hi, I'm looking at the documentation and it says you can pass 'cache' as an option to the pop-up.
http://docs.oauth.io/?Android#authorize-with-a-popup
But doing this, nothing seems to happen, and looking through the source code, I don't think there's any handling for caching? Is the documentation incorrect that it's an option in your Android code?
when calling fitbit login page is not responsive, password field is hiding by keyboard in ANdroid, but coming properly in IOS. Android fitbit login page is different then fitbit login page in IOS.
you can see difference in attached images,For IOS image name:IOS_fitbit_login and Android image: android_fitbit_login
TAG: X509Util - Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Any ideas?
From the readme page, you said the sample app is in example folder. So I want to let you know that I can neither find the sample app nor the folder you said it'll be found
The onFinished method is never called. The popup is displaying some pin, but when I press back to return to the activity, onFinished is not called
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.