Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  GC CLI - Profiles redirect port

    Posted 10-15-2025 07:58

    Hello Dev Community!

    Since the delivery of this idea, now OAuth clients can be configured to allow any port in the redirect URIs for loopback addresses. So, it would be nice if, when configuring a profile for the CLI, it allowed not only specifying a fixed port, but also making the CLI use any ephemeral free one. That way, we wouldn't have to worry if the configured port(s) were open or not.


    #PlatformCLI

    ------------------------------
    Adrián Santamaría
    ------------------------------


  • 2.  RE: GC CLI - Profiles redirect port

    Posted 28 days ago

    Hello Adrian,

    We'll take a look at it and see what we do with this in the CLI. I'll update this post once I know (it might take a bit of time - part of the team is out of office at this time).

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 3.  RE: GC CLI - Profiles redirect port

    Posted 15 days ago

    Hello Adrian,

    Just to let you know that support has been added to the last version of the CLI (144.0.0).
    Setting HTTP port to 0, when defining a profile, will tell the CLI to use an ephemeral/dynamic port.

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 4.  RE: GC CLI - Profiles redirect port

    Posted 14 days ago

    Nice! Thank you!!



    ------------------------------
    Adrián Santamaría
    ------------------------------



  • 5.  RE: GC CLI - Profiles redirect port

    Posted 14 days ago
    Edited by Adrián Santamaría 14 days ago

    Hello again... Just one thing regarding this... When I got the idea delivered, I did not see any announcements or changes in the docs. By trial and error, I discovered that the format in the OAuth client config for the Redirect URI is simply not to specify the port. So:

    https://localhost:*      -> Invalid config
    https://localhost:0      -> Valid config, but restricts it to port 0 (which makes it pretty useless)
    https://localhost        -> Enable redirect to any port
    https://localhost:443    -> Same behavior as the old https://localhost before the change

    Are my conclusions correct? Is there any documentation in the Resource/Developer Center about this that I might have missed? 

    To be honest, I feel that using * or 0 in the OAuth config would be way more intuitive. In fact, not being that way makes this a bit inconsistent (0 in the CLI = not specified in the OAuth Client)



    ------------------------------
    Adrián Santamaría
    ------------------------------



  • 6.  RE: GC CLI - Profiles redirect port

    Posted 14 days ago

    Hello,

    "By trial and error, I discovered that the format in the OAuth client config for the Redirect URI is simply not to specify the port."

    That's why I shared a link to the CLI README in my previous post: https://github.com/MyPureCloud/platform-client-sdk-cli?tab=readme-ov-file#dynamic-port

    -> "To perform an implicit login using an ephemeral port, the OAuth Client under Admin > Integrations > OAuth needs to be configured properly by setting the Grant Types property to "Token Implicit Grant (Browser)", and by adding the permissible redirect URIs without specifying a port number (e.g. http://localhost)."

    "https://localhost:443    -> Same behavior as the old https://localhost before the change" or https://localhost:{port}

    Yes. I assume for people that do not want to allow this from any port. I am not part of the Auth team. Hence the section on explicit port in the CLI README: https://github.com/MyPureCloud/platform-client-sdk-cli?tab=readme-ov-file#explicit-port

    "To be honest, I feel that using * or 0 in the OAuth config would be way more intuitive. In fact, not being that way makes this a bit inconsistent (0 in the CLI = not specified in the OAuth Client)"

    0 in the CLI is because the HTTP Port is checked in the code - to be a valid port. Feel free to submit a PR if you want to change this.

    "*" in the OAuth Client configuration - Feel free to open a ticket or an idea. I only work on the SDKs and CLI.

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 7.  RE: GC CLI - Profiles redirect port

    Posted 14 days ago

    Thank you for your answer, Jerome. Yes, I saw the comment in the GitHub Readme... But I think we can both agree that it should be explained properly here in the Resource Center, not just as a little clarification in the repo of one app. I'll submit feedback on that page, asking for it to be added.

    By the way, I think using 0 in the CLI is very sensible. It is the OAuth Client config format the one that feels weird to me. But I understand it is another team's responsibility, not yours.



    ------------------------------
    Adrián Santamaría
    ------------------------------