Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Developer's Forum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-22-2009, 09:48 PM
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
 
Join Date: Feb 2009
Location: Maryland
Posts: 248
Default How can I authenticate users on website

I have service that I want users to subscribe to and I want to authenticate the user so not just anyone can access the website.

Want this all to be server side. This is not an Application running on BB.

At first I thought I could read the BB Pin via Java (or something) but thats a no-go. Then I thought I could place a cookie on BB from my website when someone subscribes but having problem saving and retrieving cookie.

I could force user to log on EACH time with User & Password but thats a pain for the user.

Any suggestions? I'll take whatever I can get.

Thanks in advance.
__________________
Kevin
Digital Paintshop
Reply With Quote
  #2  
Old 05-22-2009, 11:39 PM
CrackBerry User
Device Model: 8900 (Curve)
Carrier: T-Mobile
 
Join Date: Mar 2009
Posts: 60
Default

Why not do an extremely small BB app - it would act as a launcher to your website, but only if they entered in their username/pass and it was stored on the BB. Think AOL IM, ICQ, MSN, etc how you save your login info... if its saved then it goes straight to the site and authenticates the login information. If not, it prompts to enter your username/pass then luanches the site and passes the info.
Reply With Quote
  #3  
Old 05-23-2009, 06:41 PM
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
 
Join Date: Feb 2009
Location: Maryland
Posts: 248
Default

Quote:
Originally Posted by morrow95 View Post
Why not do an extremely small BB app - it would act as a launcher to your website, but only if they entered in their username/pass and it was stored on the BB. Think AOL IM, ICQ, MSN, etc how you save your login info... if its saved then it goes straight to the site and authenticates the login information. If not, it prompts to enter your username/pass then luanches the site and passes the info.
Thanks for your feedback and ideas. I've thought about building the app but was hoping to not get into the app design and only handle it from the website side. I'm a programmer by trade and done a lot of embedded stuff but didn't want to learn everything for the BB. But maybe I will and make some other apps as well. Who knows.

Thanks again.

If anyone else has any ideas for handling on the server side, I'd appreciate any suggestions.
__________________
Kevin
Digital Paintshop
Reply With Quote
  #4  
Old 05-24-2009, 05:38 AM
CrackBerry Abuser
Device Model: 9000 (Bold)
Carrier: Vodafone
 
Join Date: Oct 2008
Posts: 489
Default

Quote:
Originally Posted by kwoodford View Post
I could force user to log on EACH time with User & Password but thats a pain for the user.
There are such things called cookies...
Reply With Quote
  #5  
Old 05-25-2009, 02:10 AM
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
 
Join Date: Feb 2009
Location: Maryland
Posts: 248
Default

Quote:
Originally Posted by ydaraishy View Post
There are such things called cookies...
Thanks for the info. Not sure if you read my entire post but thats what I was trying to do but not having much success. Have you done it and if so can you provide me some code or pointme in the right direction.

Any help would be greatly appreciated.

Thanks again.
__________________
Kevin
Digital Paintshop
Reply With Quote
  #6  
Old 05-27-2009, 09:02 PM
cslave's Avatar
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
PIN: PM me
 
Join Date: Feb 2009
Posts: 277
Default

Quote:
Originally Posted by kwoodford View Post
Thanks for the info. Not sure if you read my entire post but thats what I was trying to do but not having much success. Have you done it and if so can you provide me some code or pointme in the right direction.

Any help would be greatly appreciated.

Thanks again.
Why isn't this working? What's wrong?

And how are you trying to save and recover the cookies? PHP? It should work...since cookies work easily for every other website I visit on my BB I would say theres a tiny problem with your website coding (IIRC).
__________________
UNLOCKED 9530 on Verizon
230....like no other!

Problems with your BB? Ask THe Council for a quick answer to your problem!
THe Council AM
Reply With Quote
  #7  
Old 05-28-2009, 03:30 PM
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
 
Join Date: Feb 2009
Location: Maryland
Posts: 248
Default

Quote:
Originally Posted by cslave View Post
Why isn't this working? What's wrong?

And how are you trying to save and recover the cookies? PHP? It should work...since cookies work easily for every other website I visit on my BB I would say theres a tiny problem with your website coding (IIRC).
cslave,
I can get cookies to work fine with Opera Mini but for some reason I can't set them using the Blackberry browser. I can't count on users having Opera. I set the cookie (same code on server for both browsers) yet when I go into cache on BB browser, it says 0 cookies. Obviously at that point I can't read them either. Go into Opera, go to same page and cookies get set, and cookies are read back without a problem.

Any suggestions?

This is my code. Can't get any simpler...

set Cookie
<?php
$value = 'Test';
setcookie("TestCookie", $value, time()+240);
?>

ReadCookie
<?php
// Print an individual cookie
echo $_COOKIE["TestCookie"];
// Another way to debug/test is to view all cookies
print_r($_COOKIE);
?>

Works with multiple cookies in Opera. Expiration set for 4 minutes but tested immediately. Tested in Blackberry, Firefox, & Internet Explorer mode.

Thanks
__________________
Kevin
Digital Paintshop
Reply With Quote
  #8  
Old 05-28-2009, 07:59 PM
cslave's Avatar
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
PIN: PM me
 
Join Date: Feb 2009
Posts: 277
Default

i dont see why that wouldn't work....

Instead of the setcookie() function try something like this. I know its arbitrary and I can't pull up my old code right now (its at work..) to see if this is what I used but give it a shot.
Code:
$_COOKIE['TestCookie'] = $value;
and to retrieve it just do a regular echo like you had in your example
Code:
echo $_COOKIE['TestCookie'];
__________________
UNLOCKED 9530 on Verizon
230....like no other!

Problems with your BB? Ask THe Council for a quick answer to your problem!
THe Council AM
Reply With Quote
  #9  
Old 05-29-2009, 01:59 PM
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
 
Join Date: Feb 2009
Location: Maryland
Posts: 248
Default

Quote:
Originally Posted by cslave View Post
i dont see why that wouldn't work....

Instead of the setcookie() function try something like this. I know its arbitrary and I can't pull up my old code right now (its at work..) to see if this is what I used but give it a shot.
Code:
$_COOKIE['TestCookie'] = $value;
and to retrieve it just do a regular echo like you had in your example
Code:
echo $_COOKIE['TestCookie'];
I thought I had already tried that but in trying again, I don't get that to work in Opera or BB browser. Tried from desktop and it didn't work either. Not sure if its because there is no expiration time but without it the cookie should be good through the end of the session.

If you check your code at work, can you let me know what you find. Otherwise, maybe I hava a setting wrong on BB but I don't think so. Seeing as how it worked in Opera, I know I have working code.

Thanks.
__________________
Kevin
Digital Paintshop
Reply With Quote
  #10  
Old 05-29-2009, 02:43 PM
cslave's Avatar
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
PIN: PM me
 
Join Date: Feb 2009
Posts: 277
Default

Quote:
Originally Posted by kwoodford View Post
I thought I had already tried that but in trying again, I don't get that to work in Opera or BB browser. Tried from desktop and it didn't work either. Not sure if its because there is no expiration time but without it the cookie should be good through the end of the session.

If you check your code at work, can you let me know what you find. Otherwise, maybe I hava a setting wrong on BB but I don't think so. Seeing as how it worked in Opera, I know I have working code.

Thanks.
Well I used my code in conjunction with a $_SESSION cookie (which also means I had to use session_start(); ). I also cleared the $_COOKIE at the end after I closed the session, so theres no way to check if it was persistent or not.

I only get back to work on Wednesday, so until then I won't be able to check.

Btw, check out http://dreamincode.net. Its a great, huge community of helpful programmers who can most likely figure this out faster than I can.
__________________
UNLOCKED 9530 on Verizon
230....like no other!

Problems with your BB? Ask THe Council for a quick answer to your problem!
THe Council AM
Reply With Quote
  #11  
Old 05-29-2009, 05:33 PM
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
 
Join Date: Feb 2009
Location: Maryland
Posts: 248
Default

Thanks for the info. I registered at Programming and Web Development Help | DreamInCode.net and I'll see what I can find. If you think of anything, let me know

Thanks.
__________________
Kevin
Digital Paintshop
Reply With Quote
  #12  
Old 05-29-2009, 11:48 PM
cslave's Avatar
CrackBerry Abuser
Device Model: 9530 (Storm)
Carrier: Verizon
PIN: PM me
 
Join Date: Feb 2009
Posts: 277
Default

Quote:
Originally Posted by kwoodford View Post
Thanks for the info. I registered at Programming and Web Development Help | DreamInCode.net and I'll see what I can find. If you think of anything, let me know

Thanks.
Sure thing, sorry I couldn't be of more help. Im sure the people at DIC will come up with something though. Good luck!
__________________
UNLOCKED 9530 on Verizon
230....like no other!

Problems with your BB? Ask THe Council for a quick answer to your problem!
THe Council AM
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



 
 Site Support | Accessory Order Support | App Store Support | Advertise | Newsletter | About Us

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

The names RIM and BlackBerry are registered Trademarks of Research in Motion Limited.
CrackBerry.com is in No Way Affiliated with Research in Motion Limited.
Copyright ©2007-2009 Smartphone Experts. Terms and Conditions. Privacy Policy. All rights reserved.