5

We are trying to set up a Connected App for our Portal users

The issue is currently that the app passes the users to the login screen for the community or the portal they can log in, but it doesn’t return them to the site they originally wanted to login into, it just leaves them in the community/portal. However if we use the same app with a platform license pointed at the sandbox login, the same app works perfectly.

Salesforce have tested: the Authentication with a Connected App. I have followed the below doc for testing the webserver flow :

https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com#Obtaining_an_Access_Token_in_a_Web_Application_.28Web_Server_Flow.29

Making an authentication request at the authentication server.

Hitting the URL generated in the response, entered credentials of test user and then clicking on "Allow" button afterwards.

The authorization code is generated which is used to fetch access and refresh token using which I could successfully query the data.

This implies that the connected app is working absolutely fine and the issue is not at Salesforce end, therefore I would request you to check the configuration at third party end as to why the initial session is not setting up.

Detail from our Developer creating the Connected App:

The URL that we are currently building to trigger the process is…

https://rfcom-tribalgroup.cs87.force.com/services/oauth2/authorize?response_type=code&client_id=3MVG954MqIw6FnnMyDQcGg4ISrClJzp09CqRK6Cwf1cZuISppjLV1D1gh9dDUJjAiKzHyWj9bF3sq3Gpj9AkU&scope=id%20web%20openid&redirect_uri=https%3A%2F%2Fevpayments.tribalhosted.co.uk%2Fdev%2Fsits.urd%2Frun%2Fsiw_auth.salesforce&state=1EE3B346E3F14825ZVHazmyNOIKObWw7f1ofQr7OMUfnvP2e_oWEb8_3rZh41JtKSZnB9h9M1RCr-1lTsCWhh0VfcsIg-FUvudXPf3ek79n2aH-8

Obviously the “state” value doesn’t really matter, and changes each time, as this is our way of ensuring the integrity of the request.

Clicking this link takes us to the following login page…

rfcom-tribalgroup.cs87.force.com/apex/bmcservicedesk__sssitelogin?lang=en-US

1
  • 1
    Is that url also configured as Start URL in the connected app in both orgs ? Apr 28, 2016 at 10:55

1 Answer 1

0

I never know whether to post as a comment or answer... let's see.

This issue reminded me of something I saw on the G+ boards, and a solution was posted there

OK I got to the bottom of my issue. The existing custom login page had > a 'return Site.login(username, password, null);' in the login method. This meant the startURL (3rd param) was hard coded as null. I replaced with

String startURL = System.currentPageReference().getParameters().get('startURL'); return Site.login(username, password, startURL);

and now it runs through perfectly. I hope this helps!

Here's the original post.

1
  • Thanks Todd - I have sent this onto Salesforce Support who are looking into this issue for us. May 5, 2016 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .