TF-4145 Implement get oidc user_info from endpoint of oidc configuration
This commit is contained in:
@@ -78,6 +78,7 @@ export 'oidc/request/oidc_request.dart';
|
||||
export 'oidc/response/oidc_discovery_response.dart';
|
||||
export 'oidc/response/oidc_link_dto.dart';
|
||||
export 'oidc/response/oidc_response.dart';
|
||||
export 'oidc/response/oidc_user_info.dart';
|
||||
export 'oidc/token_id.dart';
|
||||
export 'oidc/token_oidc.dart';
|
||||
// Upload
|
||||
|
||||
@@ -5,7 +5,6 @@ part 'oidc_discovery_response.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true, includeIfNull: false)
|
||||
class OIDCDiscoveryResponse with EquatableMixin {
|
||||
|
||||
@JsonKey(name: 'authorization_endpoint')
|
||||
final String? authorizationEndpoint;
|
||||
|
||||
@@ -15,12 +14,26 @@ class OIDCDiscoveryResponse with EquatableMixin {
|
||||
@JsonKey(name: 'end_session_endpoint')
|
||||
final String? endSessionEndpoint;
|
||||
|
||||
OIDCDiscoveryResponse(this.authorizationEndpoint, this.tokenEndpoint, this.endSessionEndpoint);
|
||||
@JsonKey(name: 'userinfo_endpoint')
|
||||
final String? userInfoEndpoint;
|
||||
|
||||
factory OIDCDiscoveryResponse.fromJson(Map<String, dynamic> json) => _$OIDCDiscoveryResponseFromJson(json);
|
||||
OIDCDiscoveryResponse(
|
||||
this.authorizationEndpoint,
|
||||
this.tokenEndpoint,
|
||||
this.endSessionEndpoint,
|
||||
this.userInfoEndpoint,
|
||||
);
|
||||
|
||||
factory OIDCDiscoveryResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$OIDCDiscoveryResponseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$OIDCDiscoveryResponseToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [authorizationEndpoint, tokenEndpoint, endSessionEndpoint];
|
||||
}
|
||||
List<Object?> get props => [
|
||||
authorizationEndpoint,
|
||||
tokenEndpoint,
|
||||
endSessionEndpoint,
|
||||
userInfoEndpoint,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'oidc_user_info.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true, includeIfNull: false)
|
||||
class OidcUserInfo with EquatableMixin {
|
||||
@JsonKey(name: 'sid')
|
||||
final String? id;
|
||||
|
||||
final String? email;
|
||||
|
||||
final String? sub;
|
||||
|
||||
final String? name;
|
||||
|
||||
@JsonKey(name: 'given_name')
|
||||
final String? givenName;
|
||||
|
||||
@JsonKey(name: 'family_name')
|
||||
final String? familyName;
|
||||
|
||||
const OidcUserInfo({
|
||||
this.id,
|
||||
this.sub,
|
||||
this.name,
|
||||
this.givenName,
|
||||
this.familyName,
|
||||
this.email,
|
||||
});
|
||||
|
||||
/// Factory for creating object from JSON
|
||||
factory OidcUserInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$OidcUserInfoFromJson(json);
|
||||
|
||||
/// Convert object to JSON map
|
||||
Map<String, dynamic> toJson() => _$OidcUserInfoToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
sub,
|
||||
name,
|
||||
givenName,
|
||||
familyName,
|
||||
email,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user