//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.RelyingParty {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetOpenAuth.Messaging;
using Validation;
///
/// The event details passed to event handlers.
///
public class OpenIdEventArgs : EventArgs {
///
/// Initializes a new instance of the class
/// with minimal information of an incomplete or failed authentication attempt.
///
/// The outgoing authentication request.
internal OpenIdEventArgs(IAuthenticationRequest request) {
Requires.NotNull(request, "request");
this.Request = request;
this.ClaimedIdentifier = request.ClaimedIdentifier;
this.IsDirectedIdentity = request.IsDirectedIdentity;
}
///
/// Initializes a new instance of the class
/// with information on a completed authentication attempt
/// (whether that attempt was successful or not).
///
/// The incoming authentication response.
internal OpenIdEventArgs(IAuthenticationResponse response) {
Requires.NotNull(response, "response");
this.Response = response;
this.ClaimedIdentifier = response.ClaimedIdentifier;
}
///
/// Gets or sets a value indicating whether to cancel
/// the OpenID authentication and/or login process.
///
public bool Cancel { get; set; }
///
/// Gets the Identifier the user is claiming to own. Or null if the user
/// is using Directed Identity.
///
public Identifier ClaimedIdentifier { get; private set; }
///
/// Gets a value indicating whether the user has selected to let his Provider determine
/// the ClaimedIdentifier to use as part of successful authentication.
///
public bool IsDirectedIdentity { get; private set; }
///
/// Gets the details of the OpenID authentication request,
/// and allows for adding extensions.
///
public IAuthenticationRequest Request { get; private set; }
///
/// Gets the details of the OpenID authentication response.
///
public IAuthenticationResponse Response { get; private set; }
}
}