[twitter-dev] Re: 401 Error, "could not authenticate you" problem

2009-08-18 Thread JDG
are you sure your encode method is correctly base64-encoding the
credentials?

On Tue, Aug 18, 2009 at 08:18, havis  wrote:

>
> Hello Adam, actually i am using basic authentication sending login and
> password as a header request:
>
>String url = "http://twitter.com/statuses/
> friends_timeline.xml 
> ";
>String credentials = "username:password";
>credentials = encode(credentials); // this
> method encode
> the login and password as base64
>HttpConnection con =
> (HttpConnection)Connector.open
> (url);
>con.setRequestProperty("Authorization", "Basic "
> +
> credentials);
>con.setRequestMethod("GET");
>con = (HttpConnection)Connector.open(url);
>InputStream is1 = con.openInputStream();
>showReply(con, is1); // This method displays in
> the
> screen the reply from twitter that i have showed before.
>is1.close();
>
> This source code is j2me, i have implemented a similar code in java
> and it works fine, no authentication problem but when i use the code
> above, there is always the authentication problem message. Any idea?
> thanks.
>
> On 17 ago, 22:46, Adam Shannon  wrote:
> > On Mon, Aug 17, 2009 at 9:42 PM, havis  wrote:
> >
> > > Hello, i am working on a project for mobile phones and Twitter API. I
> > > made tests using java platform and everything works ok, when i use the
> > > same credentials in j2me, there is always the following message as
> > > response:
> >
> > > 
> > > 
> > >  /statuses/friends_timeline.xml
> > >  Could not authenticate you.
> > > 
> >
> > > I am using basic authentication. Did you have this problem? Can
> > > anybody help me please? thanks in advance.
> >
> > Are you using this basic format?
> > http[s]://username:passw...@twitter.com/authenticate/
> >
> > --
> > - Adam Shannon (http://ashannon.us)
>



-- 
Internets. Serious business.


[twitter-dev] Re: 401 Error, "could not authenticate you" problem

2009-08-18 Thread havis

Hello Adam, actually i am using basic authentication sending login and
password as a header request:

String url = "http://twitter.com/statuses/
friends_timeline.xml";
String credentials = "username:password";
credentials = encode(credentials); // this method 
encode
the login and password as base64
HttpConnection con = (HttpConnection)Connector.open
(url);
con.setRequestProperty("Authorization", "Basic " +
credentials);
con.setRequestMethod("GET");
con = (HttpConnection)Connector.open(url);
InputStream is1 = con.openInputStream();
showReply(con, is1); // This method displays in the
screen the reply from twitter that i have showed before.
is1.close();

This source code is j2me, i have implemented a similar code in java
and it works fine, no authentication problem but when i use the code
above, there is always the authentication problem message. Any idea?
thanks.

On 17 ago, 22:46, Adam Shannon  wrote:
> On Mon, Aug 17, 2009 at 9:42 PM, havis  wrote:
>
> > Hello, i am working on a project for mobile phones and Twitter API. I
> > made tests using java platform and everything works ok, when i use the
> > same credentials in j2me, there is always the following message as
> > response:
>
> > 
> > 
> >  /statuses/friends_timeline.xml
> >  Could not authenticate you.
> > 
>
> > I am using basic authentication. Did you have this problem? Can
> > anybody help me please? thanks in advance.
>
> Are you using this basic format?
> http[s]://username:passw...@twitter.com/authenticate/
>
> --
> - Adam Shannon (http://ashannon.us)


[twitter-dev] Re: 401 Error, "could not authenticate you" problem

2009-08-17 Thread Adam Shannon
On Mon, Aug 17, 2009 at 9:42 PM, havis  wrote:

>
> Hello, i am working on a project for mobile phones and Twitter API. I
> made tests using java platform and everything works ok, when i use the
> same credentials in j2me, there is always the following message as
> response:
>
> 
> 
>  /statuses/friends_timeline.xml
>  Could not authenticate you.
> 
>
>
> I am using basic authentication. Did you have this problem? Can
> anybody help me please? thanks in advance.
>

Are you using this basic format?
http[s]://username:passw...@twitter.com/authenticate/


-- 
- Adam Shannon ( http://ashannon.us )