All Projects → sitefinitysteve → nativescript-auth0

sitefinitysteve / nativescript-auth0

Licence: other
Nativescript Auth0 https://auth0.com/ social authentication plugin

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
Vue
7211 projects
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to nativescript-auth0

Supertokens Core
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
Stars: ✭ 2,907 (+5000%)
Mutual labels:  auth0, social-login
ertis-auth
Generic token generator and validator service like auth
Stars: ✭ 28 (-50.88%)
Mutual labels:  auth0
nativescript-vue-typescript-seed
Get started using NativeScript and Vue with TypeScript quick and easy
Stars: ✭ 22 (-61.4%)
Mutual labels:  nativescript
nativescript-yoonit-websocket
Build modern apps using NativeScript and WebSocket in Android and iOS
Stars: ✭ 62 (+8.77%)
Mutual labels:  nativescript
nativescript-whatsapp-template
NativeScript Template Similar to WhatsApp
Stars: ✭ 61 (+7.02%)
Mutual labels:  nativescript
auth0-xamarin-oidc-samples
Auth0 OIDC Client with Xamarin applications
Stars: ✭ 26 (-54.39%)
Mutual labels:  auth0
authing.js
🖥 Authing SDK for JavaScript and Node.js
Stars: ✭ 540 (+847.37%)
Mutual labels:  auth0
fastapi-auth0
FastAPI authentication and authorization using auth0.com
Stars: ✭ 104 (+82.46%)
Mutual labels:  auth0
nativescript-snackbar
NativeScript plugin for Material Design Snackbar
Stars: ✭ 22 (-61.4%)
Mutual labels:  nativescript
remix-auth
Simple Authentication for Remix
Stars: ✭ 929 (+1529.82%)
Mutual labels:  auth0
auth0-rocket-rust-example
Rocket app that authenticates users with Auth0
Stars: ✭ 30 (-47.37%)
Mutual labels:  auth0
laravel-passport-socialite
The missing social authentication plugin (i.e. SocialGrant) for laravel passport.
Stars: ✭ 50 (-12.28%)
Mutual labels:  social-login
auth0
Auth0 API in Haskell
Stars: ✭ 26 (-54.39%)
Mutual labels:  auth0
marketplace-feedback
This repository is for feedback regarding NativeScript Marketplace. Use the issues system here to submit feature requests, vote for existing ones or report bugs.
Stars: ✭ 16 (-71.93%)
Mutual labels:  nativescript
insomnia
😪 NativeScript plugin to keep the device awake (not dim the screen, lock, etc)
Stars: ✭ 40 (-29.82%)
Mutual labels:  nativescript
keystone-nextjs-auth
A package that add social auth to Keystone-6 (https://keystonejs.com/) by using next-authjs (https://next-auth.js.org/)
Stars: ✭ 60 (+5.26%)
Mutual labels:  auth0
logto
🧑‍🚀 Logto helps you build the sign-in, auth, and user identity within minutes. We provide an OIDC-based identity service and the end-user experience with username, phone number, email, and social sign-in, with extendable multi-language support.
Stars: ✭ 3,421 (+5901.75%)
Mutual labels:  social-login
fastapi-cloudauth
Simple integration between FastAPI and cloud authentication services (AWS Cognito, Auth0, Firebase Authentication).
Stars: ✭ 221 (+287.72%)
Mutual labels:  auth0
nativescript-app-shortcuts
👇 Home Icon Actions for your NativeScript app, now also for Android!
Stars: ✭ 45 (-21.05%)
Mutual labels:  nativescript
JWT-user-auth-API-bolilerplate
Boilerplate for backend API user authentication with JWT
Stars: ✭ 13 (-77.19%)
Mutual labels:  auth0

NativeScript Auth0

Auth0 is a social login provider for NativeScript allowing you to choose between 50 different providers. Use the Auth0 portal to select and configure the providers you would like to make available in your NativeScript application. The Auth0 NativeScript plugin will dynamically load your chosen providers into your application.

The dynamically loading feature reduces the amount of dependencies you’ll have in your application. You also don’t have to worry about loading and managing Cocoapods or Android Jars specific to each implementation.

Auth0 is a freemium service. The free tier supports up to 7,000 active users. Auth0 paid service levels are very reasonable.

In addition to managing many login providers, Auth0 also has solutions for application analytics, logging, web tasks and more. Take a look at all of the Auth0 features and services.

Requires NativeScript version >=7.0.0.

Installation

tns plugin add nativescript-auth0

Go to your Auth0.com backend and configure your CallbackUrls, DO NOT USE THE KEYS IN THE DEMO Configure Callback URLs

Syntax should be:

<!-- iOS -->
{YOUR_BUNDLE_IDENTIFIER}://${YOUR_AUTH0_DOMAIN}/ios/{YOUR_BUNDLE_IDENTIFIER}/callback

<!-- Android -->
https://{YOUR_AUTH0_DOMAIN}/android/{YOUR_APP_PACKAGE_NAME}/callback

iOS

Add this to your Info.plist

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>None</string>
        <key>CFBundleURLName</key>
        <string>auth0</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>{YOUR_APP_BUNDLE_IDENTIFIER}</string>
        </array>
    </dict>
</array>

Implement Delegate

Sample Delegate

How to initalize it in app.ts

Android

Add this to your AndroidManifest.xml

<activity
    android:name="org.nativescript.auth0.RedirectActivity"
    tools:node="replace">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:host="YOUR_AUTH0_DOMAIN"
            android:pathPrefix="/android/${applicationId}/callback"
            android:scheme="https" />
    </intent-filter>
</activity>

Include RedirectActivity file

Create a custom webpack configuration and add 'nativescript-auth0/android/provider/redirectActivity' to appComponents.

See the demo's nativescript.config.js#L11 and webpack.custom.config.js for an example.

Usage

Import Auth0 in a shared helper or something

import { Auth0, Credentials, WebAuthException } from 'nativescript-auth0';

Create your Auth0 object

this.auth0 = new Auth0('<your clientid>', '<your domain>');

Start the web authentication flow, returns a promise

this.auth0.webAuthentication({
    scope: 'openid offline_access'
}).then((result: Credentials) => {
    console.log(result);
}).catch((error: Error | WebAuthException) => {
    console.log(error);
});

Methods

Name Description Docs Returns
webAuthentication(options) Starts the web authentication flow to login a user Link Promise<Credentials>
renewCredentials(refreshToken) Renews credentials using refresh token Link Promise<Credentials>
revokeRefreshToken(refreshToken) Revokes refresh token Link Promise<void>
getUserInfo(accessToken) Returns the current user details, might want to cache the results Link Promise<UserInfo>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].