Mock sample for your project: PhantAuth API

Integrate with "PhantAuth API" from phantauth.net in no time with Mockoon's ready to use mock sample

PhantAuth

phantauth.net

Version: 1.0.0


Use this API in your project

Integrate third-party APIs faster by using "PhantAuth API" ready-to-use mock sample. Mocking this API will help you accelerate your development lifecycles and improves your integration tests' quality and reliability by accounting for random failures, slow response time, etc.
It also helps reduce your dependency on third-party APIs: no more accounts to create, API keys to provision, accesses to configure, unplanned downtime, etc.

Description

Random User Generator + OpenID Connect Provider. Like Lorem Ipsum, but for user accounts and authentication.
The PhantAuth API documentation is available on the following API documentation sites:
apiary (primary source)
speca
PhantAuth Developer Portal
TL;DR
PhantAuth was designed to simplify testing for applications using OpenID Connect authentication by making use of random generated users.
endpoint | address
--------- | -------
issuer | https://phantauth.net
discovery | https://phantauth.net/.well-known/openid-configuration
credential | value
------------- | -----
client_id | test.client
client_secret | UTBcWwt5
OpenID Connect
The OpenID Connect Provider of PhantAuth supports the flows listed in the OpenID Connect specifications (Hybrid, Implicit, Authorization Code), as well as the Resource Owner Password grant type, specified in the OAuth 2.0 specifications. PhantAuth as an OpenID Connect Provider can be integrated with a variety of web applications, mobil applications, and backend applications. The integration can be either direct, as in the case of the OpenID Connect Provider, or through an authentication integration service, as in the case of Auth0 or Azure Active Directory B2C. To learn more, please go to chapter Integration.
Examples:
Direct OpenID Connect integration
Auth0 Social Connections integration
Azure Active Directory B2C integration
Random User
The random user generator of PhantAuth can also be used separately, independent of the OpenID Connect Provider. You can generate an optional number of test users. In the knowledge of their user name, the data of the generated users can be regenerated at any time (OpenID Connect sub claim). The generated users have a unique, operational, disposable email address, a profile picture selected from one of the multiple pools of pictures, and the usual profile data. Custom email addresses and profile pictures may also be added. The random user generator of PhantAuth can be fully customized. Additionally, you can link an external generator to the application. For details,please go to chapter Generator.
Test pages:
Default Generator Test Page (embedded generator)
Greek Gods Generator Test Page (embedded generator working from a Google Sheet)
Faker Generator Test Page (external generator using Javascript Faker library)
Chance Generator Test Page (external generator using Javascript Chance library)
Casual Generator Test Page (external generator using Javascript Casual library)
Randomuser Generator Test Page (client side generator using https://randomuser.me)
uinames Generator Test Page (client side generator using https://uinames.com)
Mockaroo Generator Test Page (client side generator using https://mockaroo.com)
Every random generated user has a profile page, which contains their profile data in a simple one-page format.
Profile examples:
Random Profile
Random Greek God Profile
Random Faker Profile
Random Chance Profile
Random Casual Profile
CodeSandbox
The use of the random user generator and the direct integration of the OpenID Connect is demonstrated through a set of CodeSandbox samples. The sample applications are run directly from CodeSandbox, so the source code is easy to view, edit, and test.
Examples:
Random User Generator usage exampe
OpenID Connect direct integration exampe
Tenants
The PhantAuth is extremely versatile and customizable. You can use your own random user service, or generate users from an external .csv file or Google Sheet. You can use a set of Bootstrap themes to tailor the look and feel of the profile, morover, you can fundamentally change the same look and feel by the use of your own HTML templates. To find out more, please go to chapter Tenant.
To customize the application, you need to use one or more so-called tenants. A tenant can be consiered as an independent PhantAuth service. A tenant has its own random user generator endpoints and OpenID Connect endpoints.
The tenants can be organised into so-called domains. Practically, a domain is a DNS zone, which contains the settings of the given tenant(s). The tenants as well as the domain can be configured by the use of DNS TXT records.
In addition to the default tenant, the PhantAuth domain contains some sample tenants, which are primarily designed to demonstrate customizability, a range of hosting possibilities, and the links to external services. In most cases, using the default tenant is enough.
PhantAuth Default - default tenant, based on a Java Fairy library
Greek Gods - based on a Google Sheet document
PhantAuth Faker - based on a Javascript Faker library, hosted at https://now.sh
PhantAuth Chance - based on a Javascript Chance library, hosted at https://now.sh
PhantAuth Casual - based on a Javascript Casual library, hosted at https://webtask.io
RANDOM USER - based on https://randomuser.me service
uinames - based on https://uinames.com service
Mockaroo - based on https://mockaroo.com service
Anyone can create a domain and the tenants. Sharing the tenants is facilitated by the PhantAuth Shared Domain. A shared domain is connected to the phantauth.cf DNS zone, where anyone can create tenant configuration nodes by the use of the FreeDNS service.
Concept
The internal structure of PhantAuth is modular enough to allow certain elements to be customized or even replaced. The customized PhantAuth instances can be considered as separate services, which are independent from the original one. For the sake of simplicity, the customized PhantAuth instances will be called tenants.
The customized PhantAuth instances (tenants) have a different URL from that of the default tenant. For technological and cloud hosting purposes, it is advised that only the beginning of the path component of these URLs differs from the default PhantAuth URL. Similarly, the path component of a tenant URL should start with a low line character ("_"). So the general format of a tenant URL is:
In the above example: The email address of the user generated by the user generator is [email protected] (and his name is Ivan Test Szkiba). The profile page of this example can be found here.
Custom Generators
PhantAuth can use external data sources and generators as well. The only restriction is that the external generator has to be deterministic. This means that even if called several times, it has to generate the same object to the same identifier.
A special case of external generators is if an external data source is used. In such cases, the properties of a given object can be provided in a comma separated value (CSV) file or a Google Sheets document.
The external data sources and generators can be defined by the use of so-called tenants. To learn more, please go to chapter Tenant.