🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 22, 2026

How to Add Social Sign-In to a Gravity Forms Form (Google, Microsoft, Apple, Facebook, LinkedIn)

GravityExtra
How to Add Social Sign-In to a Gravity Forms Form (Google, Microsoft, Apple, Facebook, LinkedIn)

Every form that asks for a name and an e-mail address asks the same two questions, and people dislike answering them: they mistype the address, they use a throwaway one, or they leave. A sign-in button next to the form removes the typing and gives you something a text field never can, an e-mail address that the visitor’s provider has already confirmed. This guide shows how to add Sign in with Google, Microsoft, Apple, Facebook and LinkedIn inside a Gravity Forms form with the Gravity Forms Social Sign-In Premium Add-on, with your own app keys, and how to do it safely.

What a social sign-in inside a form does

There are two different jobs that people call social login. The first is a login to your website: a button on the login page that signs a member in. The second, which this guide is about, is a sign-in inside a form: the visitor is filling in a request, a registration, a booking or an application, and the sign-in button fills in the fields for them. The form can then be shorter, the e-mail address is right the first time, and you know that the address was verified by the provider, not typed by hand.

The sign-in is not a replacement for the form. The visitor still reviews the filled fields and presses the submit button as usual. What changes is that the name and e-mail arrive from a source you can trust, and that you can, if you want, turn the same moment into a WordPress account.

A Gravity Forms access request form with a Sign in with row of Google, Microsoft, Apple, Facebook and LinkedIn buttons above empty name and e-mail fields and a short privacy text
The form before the visitor signs in: five buttons and a privacy text, then the ordinary fields.

The standard behind the buttons

All five providers use OAuth 2.0, and four of them (Google, Microsoft, Apple and LinkedIn) also use OpenID Connect, the layer on top of OAuth that adds a signed identity document called an ID token. The flow that the add-on follows is the one the standards recommend for sites with a server, the authorization code flow:

  1. The visitor presses a button. Your server creates a random value called state, a secret called the PKCE verifier and its hash, and, for OpenID Connect, a random nonce. It sends the visitor to the provider’s sign-in page with the hash, the state and the nonce.
  2. The visitor signs in and agrees on the provider’s page. The provider sends the browser back to your site with a one-time code and the same state.
  3. Your server checks the state, then sends the code, the verifier and your client secret straight to the provider and receives the tokens. The code is useless to anybody who sees it on the way, because they do not have the verifier or the secret.
  4. For OpenID Connect your server verifies the ID token before it believes a word of it, then fills the form.

That is a lot of small steps, and the dangerous mistakes are all in the small steps. The next sections list the ones that matter and what the add-on does about each.

Seven mistakes that make a social sign-in unsafe

1. Not checking the state

Without a state value an attacker can start a sign-in for their own account and trick a visitor into finishing it, so the visitor’s form or even their site account ends up tied to the attacker’s identity. The add-on creates a random state for every attempt, stores it on the server, accepts it once, and ties it to the visitor’s browser with a cookie. An answer with another state, an old one, a repeated one or one that came back in a different browser is refused before any code is exchanged.

2. Skipping PKCE

PKCE makes a stolen authorization code worthless. The add-on sends the S256 challenge with every request and the verifier only to the provider’s token address, from your server.

3. Believing the ID token without checking it

An ID token is just text until it is verified. The add-on checks the signature against the keys the provider publishes, accepts the RS256 algorithm only (a token that says its algorithm is “none”, or an HMAC algorithm, is refused), and then checks the issuer, the audience (it must be your client ID), the expiry and the nonce. A token signed with any other key, meant for another app, expired or replayed is refused, and nothing is filled.

4. Trusting an e-mail address that nobody verified

This one has caught real sites. Some providers return an e-mail address that the account owner typed without confirming it. If your site signs people in by e-mail address, an attacker can create such an account with your administrator’s address and walk in. The add-on treats an address as verified only when the provider says so: the verified flag for Google, Apple and LinkedIn, the optional verified-domain claim for Microsoft. A Facebook address is never treated as verified unless you decide otherwise in code. An unverified address can still fill the form, but it never touches a WordPress account.

5. Letting a social sign-in become an admin login

Even a verified address should not open the door to a privileged account through a form on a public page. The add-on never signs in an administrator, an editor or any user with more than subscriber-level rights this way, and it looks at the rights of the user, not just the name of the role. Creating a user is limited to the subscriber role.

6. Storing the secret in plain text

The client secret of your app is a password for your site’s identity. The add-on encrypts it with AES-256-GCM before it reaches the database, never prints it again and keeps it when you save the page with the field empty.

7. Keeping more than you need

The provider tells your site a name, an e-mail address and maybe a photo address. The add-on keeps them in a temporary record for at most 30 minutes and deletes it when the entry is saved. If you want to recognise returning people, tick the option that saves the provider and a hashed user id in the entry. The real number never reaches your database.

Set it up step by step

Create the apps

You need one app for each provider you want to offer, created with your own account in the provider’s developer console. Each one gives you a client ID and a client secret, and asks you for the redirect address of your site. The add-on’s settings page shows the address for each provider with a Copy button. Paste it exactly as shown.

The Social Sign-In settings page with a card for each provider: client ID, client secret, the redirect address to copy, a Test sign-in button and the account options
One card per provider: keys, the redirect address to copy and a test button.

Enter the keys in the provider’s card, tick Enabled, save, and press Test sign-in. A small window opens, you sign in, and the card tells you whether the whole chain worked: the code exchange, the signature of the token and the claims. The test never logs anybody in or creates a user, so you can run it as often as you like.

Add the field to the form

In the form editor add the Social Sign-In field. Tick the providers, choose popup or same window, and point the field to your name, e-mail and, if you like, photo fields. The popup keeps the form exactly as it is, which matters for long or multi page forms; the same-window mode needs no popup at all and is the better choice for phones that block popups.

Tick Required if the form should only be sent by a signed-in visitor. The field then refuses a submission that has no valid sign-in behind it, and a forged value in the page is of no use, because the add-on only believes its own record of the sign-in.

The same form after signing in with Google: the first name, last name, e-mail address and photo address are filled in and a line says Signed in with Google
After the sign-in the name, e-mail and photo fields are filled from the verified profile.

Decide what happens to accounts

Nothing happens to WordPress users unless you tick one of the two options. Sign in an existing user with the same verified e-mail is useful for a members’ area where people already have accounts. Create a new subscriber turns a first-time sign-in into a registration. Both are off by default, and the rules above (verified address, no privileged users, no takeover) apply when they are on.

What it looks like for the visitor

The visitor sees a row of buttons above the name and e-mail fields and a short privacy text. A click opens the provider’s own page in a small window. After agreeing, the window closes by itself and the form is filled in. A line under the buttons says which provider was used and with which address. Pressing the submit button sends the form like any other.

On the entry side you see the ordinary entry and, if you ticked the option, the provider and a short hash.

Privacy and consent

Signing in tells the provider that the visitor is using your site, and tells your site the visitor’s name and e-mail. The add-on shows a short privacy text under the buttons that you can edit, and it adds a suggested paragraph to the privacy policy helper of WordPress. Whether you need explicit consent before the sign-in depends on your legal basis. A consent field above the buttons, with conditional logic on the sign-in field, is an easy way to ask first.

Common problems and how to solve them

  • The provider says the redirect address does not match. Copy the address from the card again. It must be identical, including https, the path and the name at the end. Some consoles need a minute to accept a new address.
  • The popup closes and nothing is filled. The sign-in must end in the same browser. A privacy setting that blocks all cookies for your site prevents the add-on from tying the sign-in to the browser, and the add-on then refuses it on purpose.
  • Apple does not show the name the second time. This is how Apple works: the name is sent once, on the first sign-in to your app. The e-mail address is always in the token.
  • Microsoft accounts do not log in existing users. That is deliberate. Microsoft tokens carry an address the account owner typed, so they fill the form but never open an existing account unless Microsoft marks the address as verified.
  • You switched the app to another site name. Update the redirect address in the app and in the card.

Checklist before you publish

  • The site runs on https and the redirect address of every app is registered.
  • Each provider card passed its test.
  • The privacy text under the buttons says what you do with the data, and your privacy policy mentions the providers.
  • The two account options are set the way you intend, and you tested them with a throwaway address.
  • The form works on a phone and on a multi page layout.

The Gravity Forms Social Sign-In Premium Add-on gives you the field, the five providers, the checks and the settings page described here. See the features, the price and the setup guide on the add-on page.

See the Social Sign-In add-on

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr