Coder Social home page Coder Social logo

yomralioglumert / flutter-authentication Goto Github PK

View Code? Open in Web Editor NEW

This project forked from auth0-blog/flutter-authentication

0.0 0.0 0.0 406 KB

Get Started with Flutter Authentication

Ruby 23.57% Objective-C 0.66% Kotlin 2.19% Dart 66.56% Swift 7.03%

flutter-authentication's Introduction

Get Started with Flutter Authentication

Read Get Started with Flutter Authentication to learn how to build the application hosted in this repository.

Flutter is Google's cross-platform UI toolkit created to help developers build expressive and beautiful mobile applications. In the article, you will learn how to build and secure a Flutter application with Auth0 using the open-source AppAuth library with the flutter_appauth wrapper plugin.

What You'll Build

Flutter login screen Auth0 prompt page in a Flutter app
Auth0 Universal Login Page in a Flutter app Flutter profile screen

Project Setup

  • Clone project.

  • Install dependencies by clicking "Pub get" in your IDE or run the following command in the project root:

flutter pub get

Set Up Auth0

Auth0 is an Identity-as-a-Service (IDaaS) platform that provides developers with features such as Social and Passwordless Login, among others, to ease online identity management.

To integrate Auth0 into your Flutter app, you need an Auth0 account. If you have an existing account, you can use it. If you don't, click here to create a free account.

After creating an Auth0 account, follow the steps below to set up an application:

  • Go to the Applications section of your dashboard.
  • Click on the "Create Application" button.
  • Enter a name for your application (e.g., "Flutter Application").
  • Finally, select Native as the application type and click the Create button.

Auth0 Create application screen for Flutter app

Your application should have at least one enabled Connection. Click on the "Connections" tab on your application page and switch on any database or social identity provider (e.g., Google).

Auth0 connections for Flutter apps

Finally, navigate to the "Settings" tab on your application page and set a callback URL in the Allowed Callback URLs field. For this demo, your callback URL should be the following value:

com.auth0.flutterdemo://login-callback

Here is how it should look in your Application settings page:

Auth0 callback settings for Flutter apps

Once you set the callback URL value, scroll to the bottom of the page and click on the "Save Changes" button. You should receive a confirmation message stating that your changes have been saved.

The purpose of the callback URL is to provide a mechanism by which an authorization server communicates back to your Flutter application.

Open lib/main.dart and update the "Auth0 Variables" section with the values from your Auth0 Application settings:

  • AUTH0_DOMAIN is the value of the Domain.

  • AUTH0_CLIENT_ID is the value of the Client ID.

Run the Application

Launch either the iOS simulator or Android emulators, then run the application on all available devices like so:

flutter run -d all

flutter-authentication's People

Contributors

bajcmartinez avatar danoncall avatar ahmetbombaci avatar abbaspour avatar maikub 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.