-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK-3234] Web Auth implementation on Android for login & logout (#17)
* chore: prep manifests for Android SDK and include dependency on Auth0.Android * chore: add VSCode launch targets for Flutter * chore: add generic extension on map to get value or null * feat: web auth login on Android * chore: rename map extension and use in web auth result * chore: rename expiresAt to expiresIn * chore: read domain and client ID from method call arguments * Add Logout functionality * Add logout tests * Refactor tests for WebAuth * Fix broken tests * Remove unused test file, and module import * Fix tests * update tests * chore: move auth0 config into strings resource file * chore: make scheme configurable through message channel * Update auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/Auth0FlutterWebAuthMethodCallHandler.kt Co-authored-by: Frederik Prijck <[email protected]> * chore: use configured scheme for logout * chore: get Auth0 vars from .env * chore: copy .env file in CI * chore: copy .env example for iOS and Android builds * chore: pass all options through to Android webauth login * chore: pass scheme through to logout action * chore: favour comments over TODO() * chore: convert expiresAt to ISO 8601 string * Fix web auth tests * chore: remove flutter ios build step Co-authored-by: frederikprijck <[email protected]> Co-authored-by: Frederik <[email protected]>
- Loading branch information
1 parent
3b2287d
commit f4bf846
Showing
27 changed files
with
523 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "auth0_flutter", | ||
"cwd": "auth0_flutter", | ||
"request": "launch", | ||
"type": "dart" | ||
}, | ||
{ | ||
"name": "auth0_flutter (profile mode)", | ||
"cwd": "auth0_flutter", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "profile" | ||
}, | ||
{ | ||
"name": "auth0_flutter (release mode)", | ||
"cwd": "auth0_flutter", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "release" | ||
}, | ||
{ | ||
"name": "auth0_flutter_platform_interface", | ||
"cwd": "auth0_flutter_platform_interface", | ||
"request": "launch", | ||
"type": "dart" | ||
}, | ||
{ | ||
"name": "auth0_flutter_platform_interface (profile mode)", | ||
"cwd": "auth0_flutter_platform_interface", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "profile" | ||
}, | ||
{ | ||
"name": "auth0_flutter_platform_interface (release mode)", | ||
"cwd": "auth0_flutter_platform_interface", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "release" | ||
}, | ||
{ | ||
"name": "example", | ||
"cwd": "auth0_flutter/example", | ||
"request": "launch", | ||
"type": "dart" | ||
}, | ||
{ | ||
"name": "example (profile mode)", | ||
"cwd": "auth0_flutter/example", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "profile" | ||
}, | ||
{ | ||
"name": "example (release mode)", | ||
"cwd": "auth0_flutter/example", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "release" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.auth0.auth0_flutter"> | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.auth0.auth0_flutter"> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application> | ||
<activity | ||
android:name="com.auth0.android.provider.RedirectActivity" android:exported="true"> | ||
<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="${auth0Domain}" | ||
android:pathPrefix="/android/${applicationId}/callback" | ||
android:scheme="${auth0Scheme}" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 110 additions & 10 deletions
120
...r/android/src/main/kotlin/com/auth0/auth0_flutter/Auth0FlutterWebAuthMethodCallHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
AUTH0_DOMAIN= | ||
AUTH0_CLIENT_ID= | ||
AUTH0_CUSTOM_SCHEME= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
.buildlog/ | ||
.history | ||
.svn/ | ||
.env | ||
|
||
# IntelliJ related | ||
*.iml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
auth0_flutter/example/android/app/src/main/res/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="com_auth0_domain">elkdanger.eu.auth0.com</string> | ||
<string name="com_auth0_scheme">demo</string> | ||
</resources> |
Oops, something went wrong.