0

I have successfully created Auth. Provider from my ScreenFlow.

I want to display the callback URL in the same flow.

Can someone please tell me whether there is any way to fetch the Callback URL of a specific Auth. provider in the flow?

I appreciate any help you can provide.

3
  • 1
    Create an Apex class that does this, then call it via invocable action. salesforce.stackexchange.com/questions/74094/…
    – identigral
    Feb 28, 2022 at 22:10
  • Thank you so much @identigral, though this will return the SSO URL, it can be modified and the problem will be resolved. Thanks once again
    – Amit Kumar
    Feb 28, 2022 at 22:23
  • 1
    Please add this as an answer
    – cropredy
    Feb 28, 2022 at 22:54

1 Answer 1

0

Thanks to the guideline by @identigral I have managed to obtain the callback URL by using the following approach - here Sample_Auth is the developer name for the Auth Provider

String ssoUrl = Auth.AuthConfiguration.getAuthProviderSsoUrl(null,null,'Sample_Auth');

String callbackUrl = ssoUrl.substringBefore('/auth');

callbackUrl += '/authcallback/Sample_Auth';

I found this can also be achieved with help of the URL class, which is much easier to work with.

String baseUrl = URL.getOrgDomainUrl().toExternalForm();

String callbackUrl = baseUrl+'/services/authcallback/Sample_Auth';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.