Search code examples
c#angular.net-coreidentityserver4

end the Password and Username from Angular to the IdentityServer without redirecting


I have a working Angular APP with IdentityServer4, and when I want to login, I am redirected to the idsrv4 and I login there, and I am redirected to my Angular App.

Is it possible just to send the Username and Password to the idsrv4 without redirecting?

If it is possible, how do I create the call from Angular?


Solution

  • As all the comments say - this is not recommended for various reasons.

    https://www.scottbrady91.com/OAuth/Why-the-Resource-Owner-Password-Credentials-Grant-Type-is-not-Authentication-nor-Suitable-for-Modern-Applications

    ...but totally doable from a protocol point of view

    https://www.rfc-editor.org/rfc/rfc6749#section-4.3

    some samples:

    https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html

    https://github.com/IdentityServer/IdentityServer3.Samples/blob/master/source/Clients/JavaScriptResourceOwner/index.html#L44-L63