Learning and Learning!-- Java all the way!
Learning and Learning!-- Java all the way!
Learning and Learning!-- Java all the way!
Vic Hood wrote:Hi Bear,
Thanks for the quick reply! The logs indicate that Login class (responsible for authentication)executes correctly and Im able to print the redirect url , as well
Learning and Learning!-- Java all the way!
Learning and Learning!-- Java all the way!
Bear Bibeault wrote:You're sending a URL to foursquare that contains localhost as a server domain? Really? Think about that for a few second.
Users accessing your application need to sign-in to their foursquare account. Once they are signed in, your application can access their data.
First step in authentication is to redirect your users to:
https://foursquare.com/oauth2/authenticate?client_id=CLIENT_ID&response_type=code&redirect_uri=REDIRECT_URI;
CLIENT_ID and REDIRECT_URI are your API credentials.
If user signs in, foursquare will send a “CODE” to the path specified in redirect_uri. For instance, if your request_uri is: http://localhost:8080/foursquare/auth , foursquare will send code as GET request to your application: http://localhost:8080/foursquare/auth?code=CODE
This code is then embedded in your request to get “access_token” from foursquare. This “access_token” will be a part of all your requests to foursquare webservice. To get access_token, a GET request is sent:
https://foursquare.com/oauth2/access_token?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=authorization_code&redirect_uri=REDIRECT_URI&code=CODE
CLIENT_ID, CLIENT_SECRET and REDIRECT_URI are your API credentials while CODE is the code sent by foursquare when user signs in.
In the sample application, authentication is done by invoking “/login” (login.java). “login” servlet redirects the user to foursquare.
Learning and Learning!-- Java all the way!
Bear Bibeault wrote:I suspect they want you to send them a callback URL. But sending them localhost won't work because localhost means "whatever system you are currently on". So to them, its their system not yours.
.
.Bear Bibeault wrote:In any case, until you get your servlet working locally, it makes no sense to send anything to foursquare.
Learning and Learning!-- Java all the way!
Bear Bibeault wrote:Start from scratch explaining how you have everything set up. All this talk of foursquare in this topic is a red herring and is merely clouding the issue. You're not ready to even think of sending anything to them.
Pretend none of this topic has happened, and post your web.xml, and how you have the web app structured.
Learning and Learning!-- Java all the way!
Bear Bibeault wrote:Stop with the foursquare info. It's not relevant until you can hit the servlet yourself by typing the address in the URL bar of the browser. Again, keep the red herrings out of the discussion.
There doesn't seem to be anything wrong with the deployment descriptor as written. But where's the rest of the relevant info?
Where did you place the WEB-INF folder? Where did you place the servlet class? How are you deploying the web app?
Learning and Learning!-- Java all the way!
Learning and Learning!-- Java all the way!
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|