Single sign on for your feedback board
Sign a JWT on your server and users vote under their real names without a second account.
Free for one project and 100 votes. Paid plans start with a 14 day trial, no card.
The idea
Your server signs a short token that says who someone is. The board trusts it because only your server holds the secret that signed it.
Your server vouches for the person. The board takes its word.
Nobody creates a VoteFirst account, and your own sign in does not change.
The token is a standard JSON Web Token, so every language already has a library for it. You sign it when the person is logged in, pass it to the board, and every vote, comment and suggestion they leave is recorded against them.
Without it, a signed in customer of yours is just another anonymous visitor with a random code. With it, you see which customer asked for what, and a name on each vote.
Generate the secret once
In the dashboard, open Share & Embed, find SSO secret and press Generate. It is shown in full once, so copy it then.
Anyone who holds it can sign a token as any of your users on this board.
Put it where your server keeps its other secrets, such as an environment variable called VOTEFIRST_SSO_SECRET. It never goes in a web page, a mobile app or a public repository. This is not the embed key: the embed key sits in your page on purpose and only draws the widgets, while the SSO secret mints identities.
Single sign on is part of Pro, and the Free plan holds everything in Pro for one project and 100 votes, so you can build and test it before you pay. Lite does not include it. The plan is checked against the project owner at the moment of each request.
Sign a token
sub is your own id for the person and exp is when the token stops working. email and name are optional.
Sign four claims on your server, two of them required.
Sign with HS256, HS384 or HS512. Keep the lifetime short.
A number or a string works for sub, so an integer primary key goes in as it is, and 42 and "42" are the same person. A number that is zero, fractional or larger than a JSON number can hold exactly is refused, because two of your ids would round together and two people would share one voter. Put very long ids in a string.
Name is the name on the person's comments, and without it they still vote as themselves under a generated handle. Email is kept on their profile. Both are refreshed from every token, so a name you correct in your product is corrected here on the person's next visit.
Keep the token short lived, an hour is plenty. It is checked again on every request instead of being traded for a session, and nothing withdraws one token before it expires.
const jwt = require('jsonwebtoken');
const token = jwt.sign(
{ sub: String(user.id), email: user.email, name: user.name },
process.env.VOTEFIRST_SSO_SECRET,
{ algorithm: 'HS256', expiresIn: '1h' }
);import os, time, jwt
token = jwt.encode(
{
'sub': str(user.id),
'email': user.email,
'name': user.name,
'exp': int(time.time()) + 3600,
},
os.environ['VOTEFIRST_SSO_SECRET'],
algorithm='HS256',
)claims := jwt.MapClaims{
"sub": strconv.Itoa(user.ID),
"email": user.Email,
"name": user.Name,
"exp": time.Now().Add(time.Hour).Unix(),
}
token, err := jwt.NewWithClaims(jwt.SigningMethodHS256, claims).
SignedString([]byte(os.Getenv("VOTEFIRST_SSO_SECRET")))In your page
Render the token into the page, or fetch it from an endpoint of your own, then pass it to the embed script after init.
Hand the token to the board on every page load.
The sign in is held in memory, so call it each time the page loads.
Call init first. After that the sign in and the widget calls can come in either order. A widget already on the page reloads itself when someone signs in, and again when you call signOut. Votes cast before signing in stay with the anonymous identity that cast them.
If your page does not run the embed script yet, three lines add it, and the guide for a React app shows where they go.
VoteFirst.init({ project: 'your-project-slug', key: 'your-embed-key' });
VoteFirst.client.signIn(TOKEN_FROM_YOUR_SERVER)
.catch(function (error) { console.error(error.message); });
VoteFirst.roadmap('#roadmap');In a Swift app
The Swift package takes the token in one call, so a person who votes on the web and in your app is one voter.
In an iOS or macOS app, pass the same token to the package.
Fetch the token from your own server, never sign it inside the app.
The secret must not ship in a binary, so the app asks your server for a token after the person logs in, then hands it over. The call throws if the board refuses it, so catch the error and let the person carry on anonymously.
Start the package once with your embed key, as in the SwiftUI feedback form guide, and call signIn after your own login succeeds.
import VoteFirst
func connectBoard() async {
do {
let token = try await fetchVoteFirstToken()
_ = try await VoteFirst.signIn(ssoToken: token)
} catch {
print("Staying anonymous: \(error)")
}
}Test it
Paste what your server produced into Test a token under Share & Embed. It records nothing and names the reason a token fails.
Test a token in the dashboard before you doubt your code.
A refusal in the page always shows the same sentence, on purpose.
The page is public, so the reason shown there stays vague. The dashboard check is the one place that names the reason a token was refused.
Then prove it end to end. Vote on something while signed in and open Voters in the dashboard. The vote should sit against the person, with the name and email the token carried, not against a generated handle.
When it fails
A refused token drops the visitor back to voting as an anonymous voter, and the error reaches the error event of the embed script.
A wrong token makes someone anonymous. It does not lock them out.
If your plan lapses, every signed in visitor quietly becomes anonymous.
That is kind to your users and easy to miss, so open the Voters list after a release and check that names are there. If they stop appearing after a billing change, check the plan before the signing code.
One exception. When Require sign in is on, the board has no anonymous voter to fall back on, so a refused token means the person cannot vote at all. Test tokens before you turn that switch on.
What the email does
Revenue weighted voting finds a voter's tier by the email on their profile. A signed in voter with a matching email counts for their tier.
Send the email, and a vote can carry the customer's weight.
A voter with no matching tier counts as one, and the plain headcount is always shown.
Import your customers from Stripe, Paddle or a CSV file and each gets a tier by email. When the same email arrives in a token, that vote is weighted. Votes from anonymous visitors carry no email, so they count as one.
A voter is named from your project and your own id, so one customer is a different voter on each of your projects, and no project can read another.
What signed votes give you
A name on every vote
You see which customer asked for what, not a random code.
No second account
People arrive from your product and vote the way they would anywhere else.
One signing for web and app
The same token identifies a person on your site and in your Swift app.
Connect your sign in in four steps
Most of it is the signing function.
Generate the secret
Press Generate under SSO secret in Share & Embed and store it as an environment variable.
Sign a token
Add sub, exp, email and name, sign with HS256 and keep the lifetime to an hour.
Hand it over
Call VoteFirst.client.signIn in the page or VoteFirst.signIn in the Swift app.
Test and vote
Paste a token into Test a token, then vote while signed in and check Voters.
What to know before you build it
- It is a signed JWT only. There is no SAML or OIDC sign in.
- A token is checked on every request and cannot be withdrawn before it expires.
- Lite does not include it, and a lapsed plan quietly turns signed in visitors anonymous.
- Votes cast before sign in are not moved to the person afterwards.
What developers ask about single sign on
Which sign in standards does it support?
A signed JWT with an HS256, HS384 or HS512 secret. There is no SAML and no OIDC.
Which plan includes it?
Pro and Lifetime, and Free, which holds everything in Pro for one project and 100 votes. Lite does not.
Where does the secret live?
On your server. It never belongs in a web page or an app, because anyone holding it can claim to be any of your users.
What happens when a token is wrong?
The visitor keeps voting anonymously and the embed script reports an error. With Require sign in on, they cannot vote.
Can a token be cancelled before it expires?
No. Nothing withdraws a single token, so keep the lifetime short.
Do votes cast before signing in move to the person?
No. They stay with the anonymous identity that cast them.
Can a customer vote on the web and in the app as one person?
Yes. The same token identifies them in both, so their votes sit on one profile.
What does it cost?
Free holds one project and 100 votes. Past that, single sign on needs Pro at $39/mo, after a 14 day trial with no card. Lite at $9/mo leaves it out.
More on running your board
More about named voters and the embed script.
Single sign on
The feature in one page.
Revenue weighted voting
Let a vote carry the plan behind it.
Add voting to a React app
The embed script inside a component.
Choose what visitors can see and do on your board
Switch voting, comments and sign in on or off.
What happens to a voter's data
What a voter record holds and what a deletion removes.
Tools with single sign on
Six tools compared: which plan signs your customers in.
Tools where visitors vote without an account
Features.Vote, ProductLift, UserJot and VoteFirst: which plans allow it.
The SSO reference
Every claim a token may carry and what the plan must be.
Know who asked for what
Free starts with one project, 100 votes. When single sign on outgrows it, Pro is $39/mo after a 14 day trial with no card.