Show / Hide Table of Contents

    Interface IRequestAuthenticationProvider

    The authentication provider interface. This is used to authenticate

    • Inbound requests from Microsoft Graph. It validates the request was issued by Microsoft Graph.
    • Outbound requests to Microsoft Graph. Tenant token is acquired to provide Microsoft Graph the permissions the bot has been consented by the tenant admin
    Namespace: Microsoft.Graph.Communications.Client.Authentication
    Assembly: Microsoft.Graph.Communications.Client.dll
    Syntax
    public interface IRequestAuthenticationProvider

    Methods

    AuthenticateOutboundRequestAsync(HttpRequestMessage, String)

    Authenticates the specified request message. This method will be called any time there is an outbound request. This method should add any required headers for authentication (eg: Authorization).

    Declaration
    Task AuthenticateOutboundRequestAsync(HttpRequestMessage request, string tenant)
    Parameters
    Type Name Description
    HttpRequestMessage request

    The outbound http request object.

    String tenant

    The tenant for which this request belongs to.

    Returns
    Type Description
    Task

    The Task. SDK awaits on this task to make sure the bot has included the required headers.

    ValidateInboundRequestAsync(HttpRequestMessage)

    Validates the inbound request. This method will be called any time we have an incoming request. Returning IsValid false will result in a Forbidden response being created. SDK waits until a successful validation is returned along with tenant data in RequestValidationResult to fire any events.

    Declaration
    Task<RequestValidationResult> ValidateInboundRequestAsync(HttpRequestMessage request)
    Parameters
    Type Name Description
    HttpRequestMessage request

    The incoming request.

    Returns
    Type Description
    Task<RequestValidationResult>

    The RequestValidationResult structure.

    Back to top Copyright (c) Microsoft Corporation. All rights reserved.