Skip to content

WebAuthenticator doesn't support Azure App Service callback response. #11641

@adrianhall

Description

@adrianhall

Description

I would like to use WebAuthenticator when also using Azure App Service Authentication. Unfortunately, EasyAuth does not return the token and expiry in a format that WebAuthenticator understands. To fix this, I propose that we add a "ResponseDecoder" option to WebAuthenticator.

Public API Changes

I'd suggest having a new interface IWebAuthenticatorResponseDecoder:

public interface IWebAuthenticatorResponseDecoder
{
  IDictionary<string, string> DecodeResponseUri(Uri uri);
}

Then, in WebAuthenticator, have a new public property:

public IWebAuthenticatorResponseDecoder? ResponseDecoder { get; set; }

This gets passed as an optional parameter to the constructor of WebAuthenticatorResult (the one that gets passed the Uri). When the response decoder is not null, it is called to convert the Uri into a dictionary (and then everything progresses as normal). When the response decoder is null, the current method (WebUtils.ParseQueryString()) is used to decode the response.

Intended Use-Case

Authenticating to Azure App Service when using Azure App Service Authentication & Authorization.

The generalized method proposed allows customers to parse the callback URL for any platform, and allows App Service to release their own package that has the decoder in it if they desire.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions