This is an standalone demonstrator RP implementation that provides basic functionality for testing a relying party implementation of the FedCM API.
This is absolutely not meant for production use
To get started:
-
Clone this repository
-
Install node.js and npm
-
Install dependencies
npm install
-
Build the project
npm run build
-
Run on localhost (defaults to port 7080)
npm start
Note: The FedCM APIs can be tested using an IDP that runs on a different port on localhost.
Currently this setup only supports running on localhost or behind a reverse proxy (does not support HTTPS on its own)
Configured via config/idpConfig.json
- Add an entry to the JSON configuration array (may contain multiple). configURL
is the FedCM config URL for this IDP, clientId
the registered clientId for this relying party at the IDP.
Default example with an IDP running on localhost:8080 providing the FedCM configuration via fedcm.son
[
{
"configURL": "http://localhost:8080/fedcm.json",
"clientId": "yourClientID"
}
]
RP:
- Trigger sign-in/sign-up flow with IDP (defaults to On-click, see below)
- Profile page
- Sign-out of RP
- RP side configuration of FedCM API
- Implementation expects
- navigator.credentials.get API to resolve to a
token
which is a valid JWT signed with a shared secretxxxxxxx
- JWT is expected to contain claims sub (required), email, name and picture
- navigator.credentials.get API to resolve to a
FedCM specifics:
- FedCM Browser API
- Support for multiple IDPs. A random nonce is automatically added - Note that multi-IDP support is not properly working at this time on the browser side.
- Configurable features (via UI) are session specific and can be changed at any given time
- Usage Mode (On-click (mode=Widget), Pageload (mode=Widget), Button (mode=button - Experimental))
- Mediation Mode (optional, silent, required, conditional)
- RP context (IdentityCredentialRequestOptionsContext)
- UserInfo API
- Minimal support for different scopes