Question

I have a request to Quickbooks online in order to implement the proper single sign on (SSO) flow. I am using openid4java and getting back the first name, last name, and e-mail address just fine, but no realm id.

I used the published Intuit code as an example, my fetcher looks like this: final FetchRequest fetch = FetchRequest.createFetchRequest();

    try {
        fetch.addAttribute("FirstName", "http://axschema.org/namePerson/first", true);
        fetch.addAttribute("LastName", "http://axschema.org/namePerson/last", true);
        fetch.addAttribute("Email", "http://axschema.org/contact/email", true);
        fetch.addAttribute("RealmId", "http://axschema.org/intuit/realmId", true);
    } catch (MessageException e) {
        mLogger.warning(e.getLocalizedMessage());
        e.printStackTrace();
    }

My Auth request looks like:

openid.ns:http://specs.openid.net/auth/2.0
openid.claimed_id:http://specs.openid.net/auth/2.0/identifier_select
openid.identity:http://specs.openid.net/auth/2.0/identifier_select
openid.return_to:http://localhost:8888/qbopenid
openid.realm:http://localhost:8888/qbopenid
openid.assoc_handle:o5SH!IAAAACLd1tm9oBJwwIhLZnb4uHYSvphLvPKupx_kJsjquipfQQAAAAEgqUSt5DXPSGwQ79I7lFlHh8gGWpBFaXdjr6diKdticDtCpv8EgpBpO3lDHIhT-275K8lDxZWoeLxqABigxYjf
openid.mode:checkid_setup
openid.ns.ext1:http://openid.net/srv/ax/1.0
openid.ext1.mode:fetch_request
openid.ext1.type.FirstName:http://axschema.org/namePerson/first
openid.ext1.type.LastName:http://axschema.org/namePerson/last
openid.ext1.type.Email:http://axschema.org/contact/email
openid.ext1.type.RealmId:http://axschema.org/intuit/realmId
openid.ext1.required:FirstName,LastName,Email,RealmId

But when the request is returned I don't see any mention of the realm id either in the request. It's almost like it goes missing. Any idea what's wrong? Thanks!

Was it helpful?

Solution

Please see the note here:

https://developer.intuit.com/docs/0025_quickbooksapi/0010_getting_started/0030_integrate_your_app/0030_signing_into_and_out_of_intuit_from_within_your_app/sign-in/implement_sso_and_openid_in_your_app

This field can only be fetched when there is an active connection between the realm and the app and when the user is launching the application from the App Center or navigating to the application from the Blue Dot menu.

You will be returned the realm at the end of the OAuth flow to associate it to the access tokens. It is not always returned by OpenID.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top