function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
admintrmpadmintrmp 

Do not have permission to open page

Does anyone know why I do not have permission to open up the application once we have granted access from a mobile device?

 

The message we get is (red is obscured information and message is typed out so not perfectly decoded):

 

APP_NAME:///mobilesdk/detect/oauth/done#access_token=______________&refresh_token=______________&instance_url=https://na9.salesforce.com&id=https://login.salesforce.com/id/______________

 

Anyone have any ideas?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Tom GersicTom Gersic

I think the "You do not have permission to open this page" message is an Android webview message. I'm guessing you're trying to load the response URI (shown below) into the webview. You should detect the callback URI at the beginning of it there and intercept it before it hits the webview. The onPageFinished method here kind of shows this: https://github.com/tomgersic/DreamforcengerHunt/blob/master/src/com/modelmetrics/dreamforcengerhunt/viewcontroller/LoginController.java

 

though I think I actually did let it render in the webview there...

 

What you could also do, instead of using APP_NAME:///mobilesdk/detect/oauth/done as your redirect URI, you could use https://login.salesforce.com/services/oauth2/success because that will load successfully in a webview.

All Answers

Tom GersicTom Gersic

That message is a successful login response. You should parse it and use the access_token value for any future API calls. Keep the refresh_token around to get a new access_token later. This blog post explains the parameters, if it's any help: http://www.modelmetrics.com/tomgersic/oauth-2-0-for-salesforce-com/

admintrmpadmintrmp

This is a successful page despite it saying that I do not have permission to open the page? What a misleading message that is.

 

 

We are trying to use jQuery with this, but what exactly do we do from here? How do we from this point to display a page in our mobile apps www folder?

Tom GersicTom Gersic

Maybe I'm not understanding -- I don't see anything in that message there that says you don't have permission. What page are you trying to open, and what error message are you getting?

admintrmpadmintrmp

Sorry I forgot to the add the beginning. We get this:

 

You do not have permission to open this page.  APP_NAME:///mobilesdk/detect/oauth/done#access_token=______________&refresh_token=______________&instance_url=https://na9.salesforce.com&id=https://login.salesforce.com/id/______________

 

Any ideas?

Tom GersicTom Gersic

I think the "You do not have permission to open this page" message is an Android webview message. I'm guessing you're trying to load the response URI (shown below) into the webview. You should detect the callback URI at the beginning of it there and intercept it before it hits the webview. The onPageFinished method here kind of shows this: https://github.com/tomgersic/DreamforcengerHunt/blob/master/src/com/modelmetrics/dreamforcengerhunt/viewcontroller/LoginController.java

 

though I think I actually did let it render in the webview there...

 

What you could also do, instead of using APP_NAME:///mobilesdk/detect/oauth/done as your redirect URI, you could use https://login.salesforce.com/services/oauth2/success because that will load successfully in a webview.

This was selected as the best answer
admintrmpadmintrmp

Fantastic! It was the callback URL. Once again, SFDC documentation (mentioned that the login.salesforce URL was for iOS only)  has failed us and premier support were unable to provide an answer.

 

Thanks for your help. :o)

 

Tom GersicTom Gersic

Cool, glad you got it working.

Amresh mishraAmresh mishra
visit my blog for best information. i have just published Amazon prime kya hai (https://www.mytargethub.com/amazon-prime-in-hindi/).
kKyword BookmarkskKyword Bookmarks
These are really amazing and valuable websites you have shared with us. Thanks for the informative post..

(KeywordBookmarks (https://www.keywordbookmarks.com/))