Legacy Dev Forum Posts

 View Only

Sign Up

Is there any way to specify the ORG in URL on authentication C#

  • 1.  Is there any way to specify the ORG in URL on authentication C#

    Posted 06-05-2025 19:22

    Anders_Vejen | 2021-11-03 11:41:11 UTC | #1

    Hi

    Our customer is using Citrix and I've developed an integration application that uses the purecloudapidotnetoauthcontrol to authenticate the user. I need user login to see user details f.ex. which queues the agent is currently part of.

    For some reason (guessing Citrix setup/policy) the agents have to enter the ORG everytime they login. Is there anyway I can modify the URL in the "purecloudapidotnetoauthcontrol" to pre-load the ORG?

    The code has this line to initiate authentication:

    // Navigate to the login URL this.Navigate($"https:\\\\login.{Environment}/authorize?clientid={ClientId}&responsetype=token&redirect_uri={RedirectUri}");

    I've found out that if I send this request in a browser, the ORG get set to "mycompany" (I've deleted the RIDcode):

    https://login.mypurecloud.ie/?rid=<RIDcode>/authenticate-adv/org/mycompany

    Is there any simpler way to do this? I don't know if the RIDcode is important either...

    BR / Anders


    anon11147534 | 2021-11-03 15:04:39 UTC | #2

    Hi Anders,

    We are currently working on adding the ability to specify an org in this library. I'll reply to this topic when the feature is released.


    anon11147534 | 2021-11-04 16:06:30 UTC | #3

    Just an FYI on this, specifying the ORG will only work when using an Authentication provider. See additional parameters for more info.


    Anders_Vejen | 2021-11-05 11:31:41 UTC | #4

    Ok super.

    I'm guessing that the purecloudapidotnetoauthcontrol is using "gsuite" as the provider?

    Will the "purecloudapidotnetoauthcontrol" be updated or shall I make my own copy?

    BR / Anders


    anon11147534 | 2021-11-05 16:35:41 UTC | #5

    We're going to start working on updating it shortly but feel free to update your own copy in the meantime.


    Anders_Vejen | 2021-11-17 16:37:42 UTC | #6

    Hi

    When I use this feature on my cloned project I get strange behaviours.

    Using your information above and in the "Additional Authorization Parameters" article I changed the URL in the oauth control to:

    this.Navigate($"https:\\\\login.{Environment}/authorize?clientid={ClientId}{orgAndProvider}{forcePrompt}&responsetype=token&redirect_uri={RedirectUri}");

    where orgAndProvider is empty or:

    $"&provider={AuthProvider}&org={OrganisationName}";

    and forcePrompt is empty or:

    "&prompt=login";

    If both orgAndProvider and forcePrompt are specified the ORG is not shown in the oauth browser login window. It just seems to default to whatever you typed in the oauth browser last, not what is specified in the URL.

    If I don't use forcePrompt I always seem to get an access token regardless of whether I'm actually logged in in any other browser windows.

    What's going on???

    BR / Anders


    Anders_Vejen | 2021-11-17 08:42:31 UTC | #7

    Hi again

    Also I'm unsure what the AuthProvider should be set to for just a user login to Genesys Cloud?

    "Gsuite"? "Okta"?

    BR / Anders


    system | 2021-12-18 08:42:44 UTC | #8

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 12542