Skip to content

Commit 23f1c00

Browse files
authored
Fix issue with login_hint and promptValues not being passed on iOS (MaikuB#65)
* fix issue where loginHint and promptValues wasn't being passed in some scenarios * update to use gradle plugin 3.5.3 * update pubspec and changelog for 0.6.0 release * update gitignore configuration * enable r8 in example * update pubspec to work with latest version of pub and fix warning around importing meta * remove podfile from checked in, update gitignore files in example app * update changelog to mention updating of pubspec
1 parent cf6438e commit 23f1c00

File tree

12 files changed

+76
-133
lines changed

12 files changed

+76
-133
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.6.0
2+
* [Android] **BREAKING CHANGE** Bump Gradle plugin to 3.5.2
3+
* [iOS] Fix issue [63](https://github.com/MaikuB/flutter_appauth/issues/63) where `login_hint` and `promptValues` was only passed when using service discovery
4+
* Update pubspec to match latest version of pub
5+
16
# 0.5.0
27
* [Android] **BREAKING CHANGE** Bump compile and target SDK versions to 29
38
* [Android] **BREAKING CHANGE** Bump Gradle plugin to version 3.5.2
@@ -29,7 +34,7 @@
2934
* Updated README to add a note suggesting developers to check the documentation of the identity provider they plan to use
3035

3136
# 0.2.1
32-
* [iOS] Fix issue where `login_hint` OAuth parameter (specified by the `loginHint` field of the `AuthorizationTokenRequest` and `AuthorizationRequest` classes). Example app has also been updated to demonstrate how to specify it
37+
* [iOS] Fix issue with `login_hint` OAuth parameter (specified by the `loginHint` field of the `AuthorizationTokenRequest` and `AuthorizationRequest` classes). Example app has also been updated to demonstrate how to specify it
3338
* Added support for specifying the `prompt` OAuth parameter. This can be specified by populating the `promptValues` field in the either the `AuthorizationTokenRequest` or `AuthorizationRequest` class. Updated example app (note: code is commented out) to demonstrate how to use it
3439

3540
# 0.2.0

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.5.2'
11+
classpath 'com.android.tools.build:gradle:3.5.3'
1212
}
1313
}
1414

example/.gitignore

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Miscellaneous
22
*.class
3-
*.lock
43
*.log
54
*.pyc
65
*.swp
@@ -16,57 +15,23 @@
1615
*.iws
1716
.idea/
1817

19-
# Visual Studio Code related
20-
.vscode/
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
2122

2223
# Flutter/Dart/Pub related
2324
**/doc/api/
2425
.dart_tool/
2526
.flutter-plugins
27+
.flutter-plugins-dependencies
2628
.packages
2729
.pub-cache/
2830
.pub/
29-
build/
31+
/build/
3032

31-
# Android related
32-
**/android/**/gradle-wrapper.jar
33-
**/android/.gradle
34-
**/android/captures/
35-
**/android/gradlew
36-
**/android/gradlew.bat
37-
**/android/local.properties
38-
**/android/**/GeneratedPluginRegistrant.java
39-
40-
# iOS/XCode related
41-
**/ios/**/*.mode1v3
42-
**/ios/**/*.mode2v3
43-
**/ios/**/*.moved-aside
44-
**/ios/**/*.pbxuser
45-
**/ios/**/*.perspectivev3
46-
**/ios/**/*sync/
47-
**/ios/**/.sconsign.dblite
48-
**/ios/**/.tags*
49-
**/ios/**/.vagrant/
50-
**/ios/**/DerivedData/
51-
**/ios/**/Icon?
52-
**/ios/**/Pods/
53-
**/ios/**/.symlinks/
54-
**/ios/**/profile
55-
**/ios/**/xcuserdata
56-
**/ios/.generated/
57-
**/ios/Flutter/App.framework
58-
**/ios/Flutter/Flutter.framework
59-
**/ios/Flutter/Generated.xcconfig
60-
**/ios/Flutter/app.flx
61-
**/ios/Flutter/app.zip
62-
**/ios/Flutter/flutter_assets/
63-
**/ios/Flutter/flutter_export_environment.sh
64-
**/ios/ServiceDefinitions.json
65-
**/ios/Runner/GeneratedPluginRegistrant.*
33+
# Web related
34+
lib/generated_plugin_registrant.dart
6635

6736
# Exceptions to above rules.
68-
!**/ios/**/default.mode1v3
69-
!**/ios/**/default.mode2v3
70-
!**/ios/**/default.pbxuser
71-
!**/ios/**/default.perspectivev3
72-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
37+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

example/android/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.5.2'
8+
classpath 'com.android.tools.build:gradle:3.5.3'
99
}
1010
}
1111

example/android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
android.enableJetifier=true
22
android.useAndroidX=true
33
org.gradle.jvmargs=-Xmx1536M
4+
android.enableR8=true

example/ios/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3
33+
34+
Podfile
35+
Podfile.lock

example/ios/Podfile

Lines changed: 0 additions & 69 deletions
This file was deleted.

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,9 @@
273273
files = (
274274
);
275275
inputPaths = (
276-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
277-
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
278276
);
279277
name = "[CP] Embed Pods Frameworks";
280278
outputPaths = (
281-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
282279
);
283280
runOnlyForDeploymentPostprocessing = 0;
284281
shellPath = /bin/sh;

ios/Classes/FlutterAppauthPlugin.m

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,22 @@ - (void)ensureAdditionalParametersInitialized:(AuthorizationTokenRequestParamete
110110

111111
-(void)handleAuthorizeMethodCall:(NSDictionary*)arguments result:(FlutterResult)result exchangeCode:(BOOL)exchangeCode {
112112
AuthorizationTokenRequestParameters *requestParameters = [[AuthorizationTokenRequestParameters alloc] initWithArguments:arguments];
113+
if(requestParameters.loginHint) {
114+
[self ensureAdditionalParametersInitialized:requestParameters];
115+
[requestParameters.additionalParameters setValue:requestParameters.loginHint forKey:@"login_hint"];
116+
}
117+
if(requestParameters.promptValues) {
118+
[self ensureAdditionalParametersInitialized:requestParameters];
119+
[requestParameters.additionalParameters setValue:[requestParameters.promptValues componentsJoinedByString:@","] forKey:@"prompt"];
120+
}
113121
if(requestParameters.serviceConfigurationParameters != nil) {
114122
OIDServiceConfiguration *serviceConfiguration =
115123
[[OIDServiceConfiguration alloc]
116124
initWithAuthorizationEndpoint:[NSURL URLWithString:requestParameters.serviceConfigurationParameters[@"authorizationEndpoint"]]
117125
tokenEndpoint:[NSURL URLWithString:requestParameters.serviceConfigurationParameters[@"tokenEndpoint"]]];
118-
if(requestParameters.loginHint) {
119-
[self ensureAdditionalParametersInitialized:requestParameters];
120-
[requestParameters.additionalParameters setValue:requestParameters.loginHint forKey:@"login_hint"];
121-
}
122-
if(requestParameters.promptValues) {
123-
[self ensureAdditionalParametersInitialized:requestParameters];
124-
[requestParameters.additionalParameters setValue:[requestParameters.promptValues componentsJoinedByString:@","] forKey:@"prompt"];
125-
}
126126
[self performAuthorization:serviceConfiguration clientId:requestParameters.clientId clientSecret:requestParameters.clientSecret scopes:requestParameters.scopes redirectUrl:requestParameters.redirectUrl additionalParameters:requestParameters.additionalParameters result:result exchangeCode:exchangeCode];
127127
} else if (requestParameters.discoveryUrl) {
128128
NSURL *discoveryUrl = [NSURL URLWithString:requestParameters.discoveryUrl];
129-
130129
[OIDAuthorizationService discoverServiceConfigurationForDiscoveryURL:discoveryUrl
131130
completion:^(OIDServiceConfiguration *_Nullable configuration,
132131
NSError *_Nullable error) {

lib/src/flutter_appauth.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import 'package:flutter/foundation.dart';
12
import 'package:flutter/services.dart';
2-
import 'package:meta/meta.dart';
33
import 'authorization_request.dart';
44
import 'authorization_response.dart';
55
import 'authorization_token_request.dart';

pubspec.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: flutter_appauth
22
description: This plugin provides an abstraction around the Android and iOS AppAuth SDKs so it can be used to communicate with OAuth 2.0 and OpenID Connect providers
3-
version: 0.5.0
4-
author: Michael Bui <michael@dexterx.dev>
3+
version: 0.6.0
54
homepage: https://github.com/MaikuB/flutter_appauth
65

76
environment:
@@ -13,5 +12,9 @@ dependencies:
1312

1413
flutter:
1514
plugin:
16-
androidPackage: io.crossingthestreams.flutterappauth
17-
pluginClass: FlutterAppauthPlugin
15+
platforms:
16+
android:
17+
package: io.crossingthestreams.flutterappauth
18+
pluginClass: FlutterAppauthPlugin
19+
ios:
20+
pluginClass: FlutterAppauthPlugin

0 commit comments

Comments
 (0)