1
//-----------------------------------------------------------------------
2 // <copyright file="OpenIdEventArgs.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth
.OpenId
.RelyingParty
{
9 using System
.Collections
.Generic
;
12 using DotNetOpenAuth
.Messaging
;
15 /// The event details passed to event handlers.
17 public class OpenIdEventArgs
: EventArgs
{
19 /// Initializes a new instance of the <see cref="OpenIdEventArgs"/> class
20 /// with minimal information of an incomplete or failed authentication attempt.
22 /// <param name="request">The outgoing authentication request.</param>
23 internal OpenIdEventArgs(IAuthenticationRequest request
) {
24 ErrorUtilities
.VerifyArgumentNotNull(request
, "request");
26 this.Request
= request
;
27 this.ClaimedIdentifier
= request
.ClaimedIdentifier
;
28 this.IsDirectedIdentity
= request
.IsDirectedIdentity
;
32 /// Initializes a new instance of the <see cref="OpenIdEventArgs"/> class
33 /// with information on a completed authentication attempt
34 /// (whether that attempt was successful or not).
36 /// <param name="response">The incoming authentication response.</param>
37 internal OpenIdEventArgs(IAuthenticationResponse response
) {
38 ErrorUtilities
.VerifyArgumentNotNull(response
, "response");
40 this.Response
= response
;
41 this.ClaimedIdentifier
= response
.ClaimedIdentifier
;
45 /// Gets or sets a value indicating whether to cancel
46 /// the OpenID authentication and/or login process.
48 public bool Cancel { get; set; }
51 /// Gets the Identifier the user is claiming to own. Or null if the user
52 /// is using Directed Identity.
54 public Identifier ClaimedIdentifier { get; private set; }
57 /// Gets a value indicating whether the user has selected to let his Provider determine
58 /// the ClaimedIdentifier to use as part of successful authentication.
60 public bool IsDirectedIdentity { get; private set; }
63 /// Gets the details of the OpenID authentication request,
64 /// and allows for adding extensions.
66 public IAuthenticationRequest Request { get; private set; }
69 /// Gets the details of the OpenID authentication response.
71 public IAuthenticationResponse Response { get; private set; }