• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

Implementing SSO with Google and Facebook Without a Hosted Login Page in FusionAuth

Scheduled Pinned Locked Moved Solved
Q&A
1
2
453
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W
    wesley
    last edited by wesley 1 Feb 2025, 16:19 31 Dec 2024, 20:03

    We want to implement Single Sign-On (SSO) functionality using Google and Facebook logins. Our goal is to replicate the redirect flow typically seen with hosted login pages but bypass the hosted page itself. Specifically, the flow we want is:

    1. User clicks "Continue with Google" on our site.
    2. The user authenticates with Google (via redirects involving FusionAuth to exchange the code).
    3. The user is redirected back to our site (callback URL).

    Is there a parameter we can include in the OAuth /authorize GET request or a specific configuration to bypass the hosted login page and directly initiate the Google authentication process?

    Currently, our workaround involves appending an arbitrary parameter to the authorize URL. On the hosted page, if this parameter exists, we use JavaScript to auto-click the Google login button; otherwise, we display the normal hosted login page. While this works, it's not ideal, so we wanted to check if there's a better solution.

    We’ve looked into the /api/identity-provider/login endpoint, but it doesn’t provide SSO benefits.

    W 1 Reply Last reply 31 Dec 2024, 20:06 Reply Quote 0
    • W
      wesley @wesley
      last edited by wesley 1 Feb 2025, 16:19 31 Dec 2024, 20:06

      To achieve this behavior, you can use IdP Hints. IdP Hints allow you to send the user directly to a specific Identity Provider (e.g., Google or Facebook) without stopping at the FusionAuth Hosted Login Page. This approach aligns with the flow you described, bypassing the hosted page entirely.

      Steps to Use IdP Hints:

      1. Append the appropriate IdP hint parameter to the /oauth2/authorize request URL.
      2. The hint will direct FusionAuth to initiate authentication with the specified IdP immediately, skipping the hosted login page.

      Documentation Reference:

      • FusionAuth Identity Provider Hints

      By using IdP Hints, you can streamline the login process and eliminate the need for JavaScript-based workarounds on the hosted login page.

      1 Reply Last reply Reply Quote 0
      • W wesley has marked this topic as solved on 31 Dec 2024, 20:06
      1 out of 2
      • First post
        1/2
        Last post