Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

ionic-team/custom-auth-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ionic Platform Custom Auth Examples

These examples will get you up and running using Ionic Auth with your own server backend.

Examples are organized by web framework. Each example runs on port 5000 and defines a route, /auth, which is the entry point.

For these examples, we will be using the shared secret foxtrot and the endpoint http://localhost:5000/auth. These custom auth config options are specified in apps.ionic.io.

custom auth setup

Use the included nodejs script to generate the URL to start the authentication process.

$ node genurl.js <YOUR_APP_ID>

Boot up your preferred example. For nodejs:

$ node express/server.js

Copy the generated URL from the genurl.js script into curl or a tool like postman.

curl -L -X GET "<GENERATED_URL>"

The token (when successfully decoded) has the following payload, but you can alter genurl.js to change what gets sent to your server.

{
    "username": "dan",
    "password": "123"
}

Upon successful authentication, you should get a JSON response with the message You have successfully implemented custom authentication! in it.

Then you can look in your users list and see your authenticated, created user.

users list

Further documentation for custom authentication can be found here.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published