GithubHelp home page GithubHelp logo

cwesterhold / flutter-auth0 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jfacoustic/flutter-auth0

0.0 0.0 0.0 136 KB

License: MIT License

Shell 0.14% Ruby 10.00% Objective-C 3.42% Kotlin 22.89% Dart 29.93% Swift 15.66% HTML 17.96%

flutter-auth0's Introduction

flutter_auth0

Unofficial Auth0 SDK for flutter.

Getting Started

iOS:

  1. Pod install in iOS directory
  2. Add the following to info.plist:
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>None</string>
        <key>CFBundleURLName</key>
        <string>auth0</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        </array>
    </dict>
</array>

Android

main/res/values/strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="com_auth0_client_id">
    <your auth0 client id></string>
<string name="com_auth0_domain">
      <your auth0 domain></string>
</resources>

build.gradle

application {
    defaultConfig {
        manifestPlaceholders += [auth0Domain: "@string/com_auth0_domain", auth0Scheme: "<your scheme>"]
    }
}

Note, I recommend your scheme be your application's id, (com.example....). It's required for Android.

Web

Add the following to index.html:

<script src="https://cdn.auth0.com/js/auth0-spa-js/1.12/auth0-spa-js.production.js"></script>

Note: Web only returns an access_token.

Login:

final Auth0Credentials credentials = await FlutterAuth0.login(
    clientId: "{YOUR AUTH0 CLIENT ID}",
    domain: "{YOUR AUTH0 DOMAIN}",
    scope: "{SCOPES}",
    scheme: "{SCHEME}" // required for android
);

Launches popup window on web. TODO: Add redirect functionality in web

Logout:

TODO

flutter-auth0's People

Contributors

jfacoustic avatar cwesterhold avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.