Accessing a SiteMinder protected page in Midlet

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

Accessing a SiteMinder protected page in Midlet

Postby RoshanDawrani » Fri Oct 06, 2006 6:07 am

Hi,
I am trying to access a SiteMinder protected webpage in my midlet but not able to. Once my request is authenticated, I am supposed to recieve a cookie named SMSESSION. Non-Siteminder cookies are coming back in response as expected but SMSESSION cookie is not coming back. What could be wrong?

If I run the exact same piece of code in the emulator, I get the SMSESSION cookie as well but not when I run it on the device.

I am using Nokia 6600.

Can someone please help? Any pointers Any thoughts?

Thanks and regards,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Sat Oct 07, 2006 3:07 am

hi, before we go deep into the discussion, first let us know what type of GPRS connection you are using and where are you from. Also tell us if you have successfuly connected http connections. These questions araise to me because, some service providers dont allow http connections from applications in their GPRS plan in India.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: Accessing a SiteMinder protected page in Midlet

Postby RoshanDawrani » Mon Oct 09, 2006 5:01 am

Hi,
I am from Bangalore and am using Hutch's GPRS connection and the plan I have allows me to make http connection. In other applications that I have written, I am able to make http connections.

However, my current application is the first application in which I am trying to login and then maintain that session for further requests through cookies. That's where I am having this issue that one SiteMinder cookie (SMSESSION), which identifies an authenticated request, is not coming back. Any thoughts on why it might be happening?

Thanks.

rgds,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Mon Oct 09, 2006 5:09 am

Let me guess, You are trying to write an application which is trying to read the data from a website which uses session ID. And you are trying to read the session ID from the url to proceed to furthur pages. is my understanding. right?
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: Accessing a SiteMinder protected page in Midlet

Postby RoshanDawrani » Mon Oct 09, 2006 5:15 am

I am trying to read data from a webpage that is protected using SiteMinder. So, I have to login first and when the login is successful, presence of a cookie in the response identifies the successful login and has the session id that identifies the user on the server.

I am not getting this particular cookie with the session id when I am running the application from my Nokia 6600. However, the same piece of code works when I run it using the emulator on my PC.

rgds,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Mon Oct 09, 2006 5:24 am

ok, The problem may be like this. When you check reading data from the emulator the user header generated by the application may be the same as IE or any other browser. And the one your mobile generates is usually MIDP 2 ..... something like this. So the website is not responding for your call. This is just an assumption. and you may make sure by doing furthur check on the website...
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: Accessing a SiteMinder protected page in Midlet

Postby RoshanDawrani » Mon Oct 09, 2006 5:30 am

Thanks for getting back.

A couple of questions:

1) I have read that there are some headers (like User Agent) that are added by MIDP implementation. Is there any way to see that finally what headers are being sent from my phone?

2) Is there a way to see what headers are being sent by my emulator? I haven't worked with packet watchers or other http watcher utilities. I am using Suse linux. Can you please let me know some way of checking the headers for both the phone and emulator?

3) If the headers are found to be different, is there anything I can do to make them same?

Another observation is that on my mobile itself I am able to access the website through Opera Mini browser but from my MIDP app, it does not work.

Can you please help with some info/pointers?

Thanks,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Mon Oct 09, 2006 5:35 am

Try opening our website now both from you application on 6600, opera browser and your emulator. I can trace your user agent. And we will find if there is any problem related to it.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: Accessing a SiteMinder protected page in Midlet

Postby RoshanDawrani » Mon Oct 09, 2006 6:09 am

Hi,
Right now I am in office and can access your website only from opera browser. Other 2 things I can try only from home actually.

I have accessed http://www.smackall.com just now from the opera browser. Can you please let me know the request header information that you recieved?

rgds,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Mon Oct 09, 2006 6:20 am

This is the information I have got.

User Agent : Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; en; U; ssr)
IP: 80.232.117.17
Date n Time: Mon, 09 Oct 2006 01:07:58 -0500

Hope this will help you.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby RoshanDawrani » Mon Oct 09, 2006 6:36 am

Hi,
Thanks for the info.

I am not really sure how to utilize this information. So even if I get this information for the eumlator and for my 6600 app and find the headers to be different, what should I do to make them same?

Can I override the headers being set by J2ME implementation?

rgds,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Mon Oct 09, 2006 6:50 am

If you find the user agent different, then you must try to change the user agent sent by the phone and then check the application. Like how, opera is sending "Opera 8.01 ..." in its header, you mush try sending the same what the emulator is sending. I am not sure if we can change the default header, but Opera has done it some way.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby RoshanDawrani » Mon Oct 09, 2006 7:15 am

Oh, I did not realize/know that Opera Mini was a Java application. Some glimmer of hope then! Thanks a lot.

Do you think that apart from User-Agent, any other request headers might also be having an effect? Is there any way to see all the request headers that are going out of the mobile? Can this information be captured somewhere/somehow?

rgds,
Roshan
RoshanDawrani
 
Posts: 7
Joined: Fri Oct 06, 2006 6:06 am

Postby DevelopmentTeam » Tue Oct 10, 2006 3:48 am

The only way I know to trace all headers is tracing from the web part. And it is a bit hard to trace it in the mobile itself. And more over, I dont think any other headers will be a problem in such case.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 1 guest

cron