Files
workavia-mail-front/model/lib/oidc/oidc_configuration.dart
T
2023-03-10 21:10:36 +07:00

37 lines
843 B
Dart

import 'package:equatable/equatable.dart';
class OIDCConfiguration with EquatableMixin {
final redirectOidcMobile = 'teammail.mobile://oauthredirect';
final wellKnownOpenId = '.well-known/openid-configuration';
final loginRedirectOidcWeb = 'login-callback.html';
final logoutRedirectOidcWeb = 'logout-callback.html';
final String authority;
final String clientId;
final List<String> scopes;
OIDCConfiguration({
required this.authority,
required this.clientId,
required this.scopes
});
String get discoveryUrl {
if (authority.endsWith('/')) {
return authority + wellKnownOpenId;
} else {
return '$authority/$wellKnownOpenId';
}
}
String get clientIdHash => clientId.hashCode.toString();
@override
List<Object?> get props => [
authority,
clientId,
scopes
];
}