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
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:
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:
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.
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.
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.
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?