OAuth Redirect URI Problem

Put your problem here if it does not fit any of the other categories.

OAuth Redirect URI Problem

Postby anushree.godbole » Mon Mar 05, 2012 12:07 am

I am developing a location based recommendation service and will be using Eventbrite API for the same. The eventbrite API uses OAuth for basic authentication. When registering the application with Eventbrite API, the application is given a application key and we have to enter a redirect URI that the user will be redirected to after they approve or deny authorization for the app. the problem is that I am not able to set the redirect URI correctly. I have tried various combinations such as http://localhost/, http://10.0.2.2:5554/, http://10.0.2.2/ or some random URI like myapp://oauthresponse but none of them seem to work.

My code is listed below:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.getSettings().setJavaScriptEnabled(true);
URL url;
try {
url = new URL("https://www.eventbrite.com/oauth/authorize?response_type=code&client_id=<<my application id>>");
myWebView.loadUrl(url.toString());
String code = url.getQuery().toString();
System.out.println(code);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

What I want is that the user be redirected to my application once he authenticates with the API and if the authentication is successful the URL will be sent back with the value of the code. I want to retrieve the code value and store it for future purposes.

Please help!

Thanks in advance.
-
Anushree
anushree.godbole
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Mar 04, 2012 1:26 pm

Top

Re: OAuth Redirect URI Problem

Postby nuetronprotron » Mon Mar 05, 2012 12:50 pm

Hi anushree,
I can see a problem with your approach is that there is no using of url and getting the connection from url.
Anyway i think the below link might be useful to you

http://marakana.com/forums/android/examples/312.html
nuetronprotron
Developer
Developer
 
Posts: 37
Joined: Tue Jan 10, 2012 10:22 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 15 guests