Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class CarpAuthService {
String? code;
String? clientId = _authProperties?.clientId;
String? redirectUri = _authProperties?.anonymousRedirectURI?.toString();
uri = _constructAuthUri(uri);

TokenResponse tokenResponse = await FlutterWebAuth2.authenticate(
url: uri,
Expand All @@ -182,6 +183,7 @@ class CarpAuthService {
),
).then((result) async {
code = Uri.parse(result).queryParameters['code'];

if ((_currentUser == null || _currentUser!.isAuthenticated) &&
code != null) {
return await FlutterAppAuth().token(
Expand Down Expand Up @@ -237,6 +239,11 @@ class CarpAuthService {
);
}

String _constructAuthUri(String uri) {
String secondPart = uri.split('action-token').last;
return '${authProperties.discoveryURL}/login-actions/action-token$secondPart';
}

/// Authenticate to this CARP service using a [username] and [password].
///
/// The discovery URL in the [authProperties] is used to find the Identity Server.
Expand Down