Quasr
  • Introduction
    • Welcome to Quasr
    • Concepts
      • Flexible Authentication
      • User-Centric Privacy
      • Modern Development
    • Terminology
    • FAQs
  • Getting Started
    • Sign up with Quasr
    • Setup your tenant
      • Factor Configuration
      • Enrolling additional factors
      • Test with the Sample Client
      • Understanding Scopes & Scores
      • Setting up an API Client (M2M)
    • Connect your app
      • Hosted Login UI
      • Custom Login UI
      • Embedded Login UI
  • Account Administration
    • Introduction
    • Account & Billing
      • Metrics
    • Tenants
    • Usage & Statistics
    • Security
  • Tenant Administration
    • Introduction
    • Dashboard
    • Tenant Settings
    • Your Security
    • Accounts
      • Tenant Admins
    • Factors
      • Factors and Scoring
      • Username (ID)
      • Identity Provider (IDP)
        • Apple
        • Facebook
        • GitHub
        • Google
        • LinkedIn
        • Slack
      • Time-based One-time Password (TOTP)
      • One-Time Password (OTP)
      • Password
      • Secret
    • Controls
      • Configuration
      • Permissions
      • Consents
      • Rules
    • Attributes
      • Capturing Claims
      • Sourcing Claims
      • Viewing Claims
      • Searching Claims / Users
      • Sharing Claims
    • Extensions
      • Synchronous
      • Asynchronous
    • Tokens
      • Session Token (OAuth 2.0)
      • Access Token (OAuth 2.0)
      • Refresh Token (OAuth 2.0)
      • ID Token (OIDC 1.0)
      • Consent Token
      • Authorization Code (OAuth 2.0)
    • Hosted Login Page
    • APIs
      • Authentication API
      • Management API (GraphQL)
  • Legal
    • Terms of Service
    • Acceptable Use Policy
    • DPA & Subprocessors
  • More Info
    • Standards
    • Security
      • Vulnerability Disclosure
      • Wall of Recognition
    • Support
    • Status
Powered by GitBook
On this page
  • Default Secret Policy
  • Signup
  • Signup with secret factor
  • Login
  • Validating an secret factor
  • Factor Creation & Configuration
  • GraphQL Example
  • Node.js Example
  • Recommended Password Managers
  • Additional Resources
  1. Tenant Administration
  2. Factors

Secret

Secrets are only stored securely hashed so secrets can not be recovered. Hence if an account loses its secret, it must re-generate the secret.

Secrets are similar to passwords but auto-generated by the authorization server and of a certain minimum length. The main purpose is its use as a client secret for client authentication, though it could also be used by any account type other than a client.

Default Secret Policy

  • minimum 43 characters length

  • maximum 43 characters length

  • no password expiration / no required password change

Secrets are case-sensitive.

The default maximum failed attempts before the factor gets temporarily disabled is 5. The factor will auto-unlock after 300 seconds (5 minutes). The counter resets to 0 on each successful login.

Secrets are stored hashed (Argon2id).

Signup

To enroll a secret factor, optionally a label (label parameter) is provided. The secret value itself is auto-generated by the Quasr service.

Signup with secret factor

POST https://{tenant_id}.api.quasr.io/factors/signup

Request Body

Name
Type
Description

label

String

Label

id*

String

Factor ID

input

String

Secret

{
  "result": "SUCCESS",
  "feedback": {
    "cause": "",
    "enrollment_id": "<enrollment id>",
    "generated_input": "<generated secret>" // in case no input is provided
  }
}

Login

To validate a secret factor, the actual secret (input parameter) is provided.

Validating an secret factor

POST https://{tenant_id}.api.quasr.io/factors/login

Request Body

Name
Type
Description

input*

String

Password

id*

String

Enrollment ID

{
  "result": "FAILED",
  "feedback": {
    "cause": "INCORRECT_INPUT",
  }
}
{
  "result": "SUCCESS",
  "feedback": {
    "cause": "",
    "enrollment_id": "<enrollment_id>"
  },
  "session_token": "<session_token>",
  "account_id": "<account_id>",
  "session_score": <session_score>,
  "session_exp": <session_expiration> // epoch in seconds (not ms)
}

Factor Creation & Configuration

The Password Factor allows for the following parameters and config options:

Parameter
Value Options
Default
Required

subtype

"secret:password"

label

<string>

status

"ENABLED" | "DISABLED"

"DISABLED"

score

<positive int>

1

config.regex

regex

"^.{15,100}"

config.unique

true | false

false

config.case_sensitive

true | false

true

config.require_validation_for_enablement

true | false

false

config.threshold

0-4

2

The following API sample calls create an Secret factor labelled "Client Secret" with a score of 6.

GraphQL Example

// GraphQL Query (Sample)
mutation createFactor ($input: CreateFactorInput!) {
    createFactor (input: $input) {
        id
    }
}

// GraphQL Variables (Sample)
{
  "input": {
    "subtype": "secret:password",
    "label": "Client Secret",
    "status": "ENABLED",
    "score": 6
  }
}

// Response (Sample)
{
    "data": {
        "createFactor": {
            "id": "8bde5565-7027-4232-8db8-3f3ca1acaeac"
        }
    }
}

Node.js Example

var axios = require('axios');
var data = JSON.stringify({
  query: `mutation createFactor ($input: CreateFactorInput!) {
    createFactor (input: $input) {
        id
    }
}`,
  variables: {
    "input": {
      "subtype": "secret:password",
      "label": "Client Secret",
      "status": "ENABLED",
      "score": 6
    }
  }
});

var config = {
  method: 'post',
  url: 'https://api.quasr.io/graphql',
  headers: { 
    'Authorization': 'Bearer {access_token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Recommended Password Managers

Secrets should be long and complex, which makes them hard or impossible to remember. The use of a password manager is recommended to keep them safe. Here is a list of password managers that we can recommend (Quasr has no affiliation with these vendors).

Additional Resources

PreviousPasswordNextControls

Last updated 1 year ago

A Password factor is already available for all newly created tenants by default, however, if you want to add additional password factors, you can do so via Tenant Administration UI or .

The Quasr Access Token used in the Authorization header in the examples below must contain the scope https://api.quasr.io/scopes/admin in order to be authorized. See

(Open Source)

(Open Source)

Admin API
API Authorization
KeepassXC
Bitwarden
1Password
Lastpass
Google Password Manager
OWASP Password Storage Recommendation
NIST Password Recommendations
Summary of 2021 NIST Password Recommendations