Show / Hide Table of Contents

    Interface IOidcProvider

    Contract that specifies the capabilities of an OpenID Connect provider

    Namespace: i5.Toolkit.Core.OpenIDConnectClient
    Assembly: cs.temp.dll.dll
    Syntax
    public interface IOidcProvider

    Properties

    AuthorizationFlow

    Gets the authorization flow that should be used for the provider

    Declaration
    AuthorizationFlow AuthorizationFlow { get; }
    Property Value
    Type Description
    AuthorizationFlow

    ClientData

    Client data that are required to authorize the client at the provider

    Declaration
    ClientData ClientData { get; set; }
    Property Value
    Type Description
    ClientData

    RestConnector

    Specifies how the REST API of the Web service is accessed

    Declaration
    IRestConnector RestConnector { get; set; }
    Property Value
    Type Description
    IRestConnector

    Methods

    CheckAccessTokenAsync(String)

    Checks if the access token is valid by checking it at the provider

    Declaration
    Task<bool> CheckAccessTokenAsync(string accessToken)
    Parameters
    Type Name Description
    String accessToken

    The access token that should be checked

    Returns
    Type Description
    Task<Boolean>

    True if the access token is valid, otherwise false

    GetAccessToken(Dictionary<String, String>)

    Gets the access token from a list of parameters in a Web answer

    Declaration
    string GetAccessToken(Dictionary<string, string> redirectParameters)
    Parameters
    Type Name Description
    Dictionary<String, String> redirectParameters

    The parameters of the Web answer as a dictionary

    Returns
    Type Description
    String

    Returns the access token if it exists in the parameters, otherwise an empty string is returned

    GetAccessTokenFromCodeAsync(String, String)

    Gets the access token based on a previously retrieved authorization code

    Declaration
    Task<string> GetAccessTokenFromCodeAsync(string code, string redirectUri)
    Parameters
    Type Name Description
    String code

    The authorization code

    String redirectUri

    The redirect URI which was used during the login

    Returns
    Type Description
    Task<String>

    Returns the access token if it could be retrieved; otherwise it returns an empty string

    GetAuthorizationCode(Dictionary<String, String>)

    Extracts the authorization code from parameters of a Web answer

    Declaration
    string GetAuthorizationCode(Dictionary<string, string> redirectParameters)
    Parameters
    Type Name Description
    Dictionary<String, String> redirectParameters

    Parameters of a Web answer as a dictionary

    Returns
    Type Description
    String

    The authorization code if it could be found, otherwise an empty string is returned

    GetUserInfoAsync(String)

    Gets information about the logged in user from the provider

    Declaration
    Task<IUserInfo> GetUserInfoAsync(string accessToken)
    Parameters
    Type Name Description
    String accessToken

    The access token to authenticate the user

    Returns
    Type Description
    Task<IUserInfo>

    Returns information about the logged in user if the request was successful, otherwise null

    OpenLoginPage(String[], String)

    Opens the provider's login page in the system's default Web browser

    Declaration
    void OpenLoginPage(string[] scopes, string redirectUri)
    Parameters
    Type Name Description
    String[] scopes

    The OpenID Connect scopes that the user must agree to

    String redirectUri

    The URI to which the browser should redirect after the successful login

    ParametersContainError(Dictionary<String, String>, out String)

    Checks if the provider included error messages in the parameters of a Web answer

    Declaration
    bool ParametersContainError(Dictionary<string, string> parameters, out string errorMessage)
    Parameters
    Type Name Description
    Dictionary<String, String> parameters

    The parameters of a Web answer as a dictionary

    String errorMessage

    The error message that the provider included, empty if no error exists

    Returns
    Type Description
    Boolean

    Returns true if the parameters contain an error message, otherwise false

    Back to top i5 Toolkit Documentation