Table of Contents

Class Standard.User.OnExtranetLoginFailedArgs

Namespace
Dynamicweb.Notifications
Assembly
Dynamicweb.dll

Provides information if authorization failed

public class Standard.User.OnExtranetLoginFailedArgs : NotificationArgs
Inheritance
Standard.User.OnExtranetLoginFailedArgs
Inherited Members

Examples

using System;
using Dynamicweb.Security.UserManagement;

namespace Dynamicweb.Examples.Notifications.Standard;

[Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed)]
public class OnExtranetLogOnFailedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
    public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
    {
        if (args is null)
            return;

        if (args is not Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)
            return;

        Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)args;
        //Throw exception if login is incorrect
        if (item.FailedReason is LogOnFailedReason.IncorrectLogin)
            throw new ArgumentException("Incorrect login");
    }
}

Remarks

Constructors

OnExtranetLoginFailedArgs()

Default constructor.

public OnExtranetLoginFailedArgs()

Remarks

This constructor is not used.

Properties

FailedReason

Gets or sets the reason.

public LogOnFailedReason FailedReason { get; init; }

Property Value

LogOnFailedReason

The reason.

Password

The password specified for login

public string? Password { get; init; }

Property Value

string

Username

The username specified for login

public string? Username { get; init; }

Property Value

string
To top