@@ -400,10 +400,18 @@ impl Client {
400
400
/// * `prompt` - The desired user experience in the web UI. No value means
401
401
/// that the user wishes to login into an existing account, and a value of
402
402
/// `Create` means that the user wishes to register a new account.
403
+ ///
404
+ /// * `login_hint` - A generic login hint that an identity provider can use
405
+ /// to pre-fill the login form. The format of this hint is not restricted
406
+ /// by the spec as external providers all have their own way to handle the hint.
407
+ /// However, it should be noted that when providing a user ID as a hint
408
+ /// for MAS (with no upstream provider), then the format to use is defined
409
+ /// by [MSC4198]: https://github.com/matrix-org/matrix-spec-proposals/pull/4198
403
410
pub async fn url_for_oidc (
404
411
& self ,
405
412
oidc_configuration : & OidcConfiguration ,
406
413
prompt : Option < OidcPrompt > ,
414
+ login_hint : Option < String > ,
407
415
) -> Result < Arc < OAuthAuthorizationData > , OidcError > {
408
416
let registration_data = oidc_configuration. registration_data ( ) ?;
409
417
let redirect_uri = oidc_configuration. redirect_uri ( ) ?;
@@ -413,6 +421,9 @@ impl Client {
413
421
if let Some ( prompt) = prompt {
414
422
url_builder = url_builder. prompt ( vec ! [ prompt. into( ) ] ) ;
415
423
}
424
+ if let Some ( login_hint) = login_hint {
425
+ url_builder = url_builder. login_hint ( login_hint) ;
426
+ }
416
427
417
428
let data = url_builder. build ( ) . await ?;
418
429
0 commit comments