DSP
DSP

Reputation: 78

How to send email id when calling identity server 4 to login

I have a angular application and identity server 4 application. I have a login page in angular app which have only user name and when user enters his username , i want to send this username to IDs 4 and based on his username i will ask him to login either using password or redirect to AZure AD (i have saved these settings in DB which mode he needs to login).

From angular we are only able to call this method this.oidcSecurityService.authorize(); Can anyone suggest the way to send the username to IS4 from angular application using the angular-auth-oidc-client library.

Upvotes: 1

Views: 1239

Answers (2)

Darren Street
Darren Street

Reputation: 1838

This works for me.

 this.oidcSecuritySvc.authorize(null, { customParams: { login_hint: '[email protected]'}});

The key is to use the login_hint as the param name. It seems to be wired up with IDServer4

Upvotes: 0

Scott Brady
Scott Brady

Reputation: 5598

OpenID Connect authorization requests can include the username in the login_hint parameter. IdentityServer will then make that available to you via the IIdentityServerInteractionService.

Your client library should allow you to set this query string parameter for authorization requests.

Upvotes: 1

Related Questions