TF-571 Setup and get OIDC configuration
This commit is contained in:
@@ -76,4 +76,5 @@ export 'identity/identity_request_dto.dart';
|
||||
// OIDC
|
||||
export 'oidc/response/oidc_response.dart';
|
||||
export 'oidc/response/oidc_link_dto.dart';
|
||||
export 'oidc/request/oidc_request.dart';
|
||||
export 'oidc/request/oidc_request.dart';
|
||||
export 'oidc/oidc_configuration.dart';
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class OIDCConfiguration with EquatableMixin {
|
||||
static const redirectOidc = 'teammail.mobile://oauthredirect';
|
||||
static const wellKnownOpenId = '.well-known/openid-configuration';
|
||||
|
||||
final String authority;
|
||||
final String clientId;
|
||||
final String redirectUrl = redirectOidc;
|
||||
final List<String> scopes;
|
||||
|
||||
OIDCConfiguration({
|
||||
required this.authority,
|
||||
required this.clientId,
|
||||
required this.scopes
|
||||
});
|
||||
|
||||
factory OIDCConfiguration.initial() {
|
||||
return OIDCConfiguration(
|
||||
authority: 'https://auth.upn.integration-open-paas.org/auth/realms/mobile',
|
||||
clientId: 'teammail-mobile',
|
||||
scopes: ['openid', 'offline_access']
|
||||
);
|
||||
}
|
||||
|
||||
String get discoveryUrl {
|
||||
if (authority.endsWith('/')) {
|
||||
return authority + wellKnownOpenId;
|
||||
} else {
|
||||
return authority + '/' + wellKnownOpenId;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
authority,
|
||||
clientId,
|
||||
scopes
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user