-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from SayNode/auth0
Auth0
- Loading branch information
Showing
29 changed files
with
786 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"dart.lineLength": 3000, | ||
"html.format.wrapLineLength": 1200 | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
...kotlin/com/example/vidaia/MainActivity.kt → .../kotlin/ch/saynode/vidaia/MainActivity.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.example.vidaia | ||
package ch.saynode.vidaia | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
|
||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,63 @@ | ||
PODS: | ||
- AppAuth (1.4.0): | ||
- AppAuth/Core (= 1.4.0) | ||
- AppAuth/ExternalUserAgent (= 1.4.0) | ||
- AppAuth/Core (1.4.0) | ||
- AppAuth/ExternalUserAgent (1.4.0) | ||
- Flutter (1.0.0) | ||
- flutter_appauth (0.0.1): | ||
- AppAuth (= 1.4.0) | ||
- Flutter | ||
- flutter_secure_storage (3.3.1): | ||
- Flutter | ||
- path_provider_ios (0.0.1): | ||
- Flutter | ||
- r_crypto (0.2.1): | ||
- Flutter | ||
- shared_preferences_ios (0.0.1): | ||
- Flutter | ||
- url_launcher_ios (0.0.1): | ||
- Flutter | ||
|
||
DEPENDENCIES: | ||
- Flutter (from `Flutter`) | ||
- flutter_appauth (from `.symlinks/plugins/flutter_appauth/ios`) | ||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) | ||
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) | ||
- r_crypto (from `.symlinks/plugins/r_crypto/ios`) | ||
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) | ||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) | ||
|
||
SPEC REPOS: | ||
trunk: | ||
- AppAuth | ||
|
||
EXTERNAL SOURCES: | ||
Flutter: | ||
:path: Flutter | ||
flutter_appauth: | ||
:path: ".symlinks/plugins/flutter_appauth/ios" | ||
flutter_secure_storage: | ||
:path: ".symlinks/plugins/flutter_secure_storage/ios" | ||
path_provider_ios: | ||
:path: ".symlinks/plugins/path_provider_ios/ios" | ||
r_crypto: | ||
:path: ".symlinks/plugins/r_crypto/ios" | ||
shared_preferences_ios: | ||
:path: ".symlinks/plugins/shared_preferences_ios/ios" | ||
url_launcher_ios: | ||
:path: ".symlinks/plugins/url_launcher_ios/ios" | ||
|
||
SPEC CHECKSUMS: | ||
AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7 | ||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a | ||
flutter_appauth: 05c3778a1e4ae23364dd2ef37cbae14b244f646b | ||
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec | ||
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 | ||
r_crypto: eee8ce78a1682f290fd5788da6089edfe00b0729 | ||
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad | ||
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de | ||
|
||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c | ||
|
||
COCOAPODS: 1.11.3 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 @@ | ||
/// TODO: put these variables in --dart-define arguments | ||
/// having the variables here is a security risk | ||
/// remove after testing of the whole auth flow works | ||
const AUTH0_DOMAIN = | ||
"dev-jp7b9rk6.us.auth0.com"; // String.fromEnvironment('AUTH0_DOMAIN'); | ||
const AUTH0_CLIENT_ID = | ||
"G3EpKLVRSmOK17DbFEkubCnTGzgooiut"; // String.fromEnvironment('AUTH0_CLIENT_ID'); | ||
const AUTH0_ISSUER = 'https://$AUTH0_DOMAIN'; | ||
const BUNDLE_IDENTIFIER = 'ch.saynode.vidaia'; | ||
const AUTH0_REDIRECT_URI = '$BUNDLE_IDENTIFIER://login-callback'; | ||
const REFRESH_TOKEN_KEY = 'refresh_token'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,47 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
part 'auth0_id_token.g.dart'; | ||
|
||
@JsonSerializable() | ||
class Auth0IdToken { | ||
Auth0IdToken({ | ||
required this.nickname, | ||
required this.name, | ||
required this.email, | ||
required this.picture, | ||
required this.updatedAt, | ||
required this.iss, | ||
required this.sub, // aka subject... the userId. | ||
required this.aud, | ||
required this.iat, | ||
required this.exp, | ||
this.authTime, | ||
}); | ||
|
||
final String nickname; | ||
final String name; | ||
final String picture; | ||
|
||
@JsonKey(name: 'updated_at') | ||
final String updatedAt; | ||
|
||
final String iss; | ||
|
||
// In OIDC, "sub" means "subject identifier", | ||
// which for our purposes is the user ID. | ||
// This getter makes it easier to understand. | ||
String get userId => sub; | ||
final String sub; | ||
|
||
final String aud; | ||
final String email; | ||
final int iat; | ||
final int exp; | ||
|
||
@JsonKey(name: 'auth_time') | ||
final int? authTime; // this might be null for the first time login | ||
|
||
factory Auth0IdToken.fromJson(Map<String, dynamic> json) => | ||
_$Auth0IdTokenFromJson(json); | ||
|
||
Map<String, dynamic> toJson() => _$Auth0IdTokenToJson(this); | ||
} |
Oops, something went wrong.