Hello again,
I want to authenticate using oAuth, for which I need the browser to redirect to the external party, in my case Twitter.
Currently, I have a Servlet, which I call through RPC, which does the redirect as follows:
The problem is (and rightly so I think), that my client-side will just get a Transport Error (0).
I know that a redirect works that the server asks the browser to go to the new URL, and that is exactly what I want to do. How should I do this?
(The redirected page will ask the user if the application is allowed to modify data on twitter, and if the user allows this, he will be redirected back to my application)
I want to authenticate using oAuth, for which I need the browser to redirect to the external party, in my case Twitter.
Currently, I have a Servlet, which I call through RPC, which does the redirect as follows:
Code:
... // Create OAuth client OAuthSignpostClient oauthClient = new OAuthSignpostClient(keys.getApplicationKey(), keys.getApplicationSecret(), callback); //redirect URI url = oauthClient.authorizeUrl(); //after this they get redirected to the callback. String urlWithSessionId = response.encodeRedirectURL(url.toString()); response.sendRedirect(urlWithSessionId);
The problem is (and rightly so I think), that my client-side will just get a Transport Error (0).
I know that a redirect works that the server asks the browser to go to the new URL, and that is exactly what I want to do. How should I do this?
(The redirected page will ask the user if the application is allowed to modify data on twitter, and if the user allows this, he will be redirected back to my application)