Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
galois
Posts: 14
Registered: ‎03-29-2011
My Device: 8900

WebWorks powered app won't load resource if url contains "@" character.

Even  access element for some domain has been added to the config.xml,

system would throw an alert and won't load resource if url under the same domain contains "@" character.

 

This error happened on dev alpha simulator when doing o-auth with instagram.

Instagram login page contains resource using "@" character.

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: WebWorks powered app won't load resource if url contains "@" character.

[ Edited ]

Try escaping the @

 

e.g.

 

var hasat = encodeURIComponent('fred@example.com');

 

 

[Pinched from Wiki]...

 

List of allowed URL characters

Unreserved

May be encoded but it is not necessary

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 - _ . ~

Reserved

Have to be encoded sometimes

! * ' ( ) ; : @ & = + $ , / ? % # [ ]

 




Click the like button if you find my posts useful!
Please use plain text.
Contributor
galois
Posts: 14
Registered: ‎03-29-2011
My Device: 8900

Re: WebWorks powered app won't load resource if url contains "@" character.

Thanks for reply.

 

I can't encode it.

It happened in the o-auth 2.0 processing.

The url including "@“ is used by Instagram login page. Not under my control.

 

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: WebWorks powered app won't load resource if url contains "@" character.

Can you gimme an example URL (fake data) - not familiar with Instagram so I can see the URL makeup

 

 




Click the like button if you find my posts useful!
Please use plain text.
Contributor
galois
Posts: 14
Registered: ‎03-29-2011
My Device: 8900
Please use plain text.
Contributor
galois
Posts: 14
Registered: ‎03-29-2011
My Device: 8900

Re: WebWorks powered app won't load resource if url contains "@" character.

The process is:

1. My app start an authorize request and visit instagram login page.

2. Instagram login page shows. Users input username and password.

3. Instagram return to my app with an access token.

 

Step 2 is out of my control.

 

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: WebWorks powered app won't load resource if url contains "@" character.

Just replace any @ with %40

 

e.g. Your first one works fine ...

 

https://d36xtkk24g8jdx.cloudfront.net/bluebar/602d1e9/images/branding/glyph%402x.png




Click the like button if you find my posts useful!
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: WebWorks powered app won't load resource if url contains "@" character.

Yeah - after you do the auth req you get the token back and use than in requests I guess

 

I take it this is the bit with the @ in it

 

So just change the @ in that string to %40 in any URLs you request

 




Click the like button if you find my posts useful!
Please use plain text.
Contributor
galois
Posts: 14
Registered: ‎03-29-2011
My Device: 8900

Re: WebWorks powered app won't load resource if url contains "@" character.

No, after auth I only get a token string. I don't request any resources contain @.

Rsources contains @ are used  in login page only. 

 

I think it's impossible to solve it under WebWorks url rules.

 

Any way, thanks to your support.  

For developers, blackberry is the best and most friendly.

 

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: WebWorks powered app won't load resource if url contains "@" character.

The obvious thing to try is Ajax as that may well bypass whatever's getting in the way

 

A lot of their API looks very much like JSON

 

Sorry - can't gt into it further today, bit busy getting ready - Jam 13 flight very early in the morning :smileysad:




Click the like button if you find my posts useful!
Please use plain text.