Getting Blackbaud Auth Token

I am able to get the token from “https://oauth2.sky.blackbaud.com/token”. But the result of that goes to my success handler for the app.blackbaud.com/oauth/authorize call which is in a different window.

I think this is messing up of being able to set the resulting token into localstorage and be able to use it else where.

Has anyone ran into this issue and know of any way around it? I can see the appropriate values set in the popup window for my domain. But when I go back to the window that is open on my Add-in there is no entry for the blackbaud token.

Any help would be greatly appreciated. Or let me know if you need more info.

Comments

  • Michael Tims
    Michael Tims Blackbaud Employee
    Sixth Anniversary Kudos 2 Name Dropper Participant

    Hi @Chad Gray - there are a few sample apps in the documentation that demonstrate how to request authorization in a popup window and appropriately handle the auth callback while storing values in the session. Have you attempted to run through any of the tutorials?

    The NodeJS obtain an access token section may be useful, as well as the display authorization buttons section which shows how to invoke the authorization form in a popup window and, after successful authorization, redirect to a route which closes the popup window.

    Hope that helps! Let me know if any of those tutorial steps are difficult to follow.

  • @Michael Tims
    Thanks for the help. I ended up figuring it out.

    I am using react and since I was opening in a new window the localstorage would not work. So I needed to post a message back to the window.opener with the token information I need.

    I did it like this:
    window.opener.postMessage(

    { type: "auth-success", token: result.data.access_token },

    "*"

    );