diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-07-20 18:19:55 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-07-20 18:19:55 -0700 |
commit | ece5b5a4d7d61336a13eae8393a07be8c3bbf6b1 (patch) | |
tree | 8938938a88ecb4931ad881a26665fdc20f2927c0 | |
parent | 7f070acd6826cf3af38cd51790007173d3c3c159 (diff) | |
download | DotNetOpenAuth-ece5b5a4d7d61336a13eae8393a07be8c3bbf6b1.zip DotNetOpenAuth-ece5b5a4d7d61336a13eae8393a07be8c3bbf6b1.tar.gz DotNetOpenAuth-ece5b5a4d7d61336a13eae8393a07be8c3bbf6b1.tar.bz2 |
Added RP IAuthenticationRequest.SetCallbackArgument method that does not fail if the parameter was already added.
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs | 22 | ||||
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/IAuthenticationRequest.cs | 16 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs index 9912d0b..a14ce65 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs @@ -232,6 +232,28 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { } /// <summary> + /// Makes a key/value pair available when the authentication is completed. + /// </summary> + /// <param name="key">The parameter name.</param> + /// <param name="value">The value of the argument. Must not be null.</param> + /// <remarks> + /// <para>Note that these values are NOT protected against tampering in transit. No + /// security-sensitive data should be stored using this method.</para> + /// <para>The value stored here can be retrieved using + /// <see cref="IAuthenticationResponse.GetCallbackArgument"/>.</para> + /// <para>Since the data set here is sent in the querystring of the request and some + /// servers place limits on the size of a request URL, this data should be kept relatively + /// small to ensure successful authentication. About 1.5KB is about all that should be stored.</para> + /// </remarks> + public void SetCallbackArgument(string key, string value) { + ErrorUtilities.VerifyNonZeroLength(key, "key"); + ErrorUtilities.VerifyArgumentNotNull(value, "value"); + ErrorUtilities.VerifyOperation(this.RelyingParty.CanSignCallbackArguments, OpenIdStrings.CallbackArgumentsRequireSecretStore, typeof(IAssociationStore<Uri>).Name, typeof(OpenIdRelyingParty).Name); + + this.returnToArgs[key] = value; + } + + /// <summary> /// Adds an OpenID extension to the request directed at the OpenID provider. /// </summary> /// <param name="extension">The initialized extension to add to the request.</param> diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/IAuthenticationRequest.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/IAuthenticationRequest.cs index 8414031..27daa46 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/IAuthenticationRequest.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/IAuthenticationRequest.cs @@ -125,6 +125,22 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { void AddCallbackArguments(string key, string value); /// <summary> + /// Makes a key/value pair available when the authentication is completed. + /// </summary> + /// <param name="key">The parameter name.</param> + /// <param name="value">The value of the argument. Must not be null.</param> + /// <remarks> + /// <para>Note that these values are NOT protected against tampering in transit. No + /// security-sensitive data should be stored using this method.</para> + /// <para>The value stored here can be retrieved using + /// <see cref="IAuthenticationResponse.GetCallbackArgument"/>.</para> + /// <para>Since the data set here is sent in the querystring of the request and some + /// servers place limits on the size of a request URL, this data should be kept relatively + /// small to ensure successful authentication. About 1.5KB is about all that should be stored.</para> + /// </remarks> + void SetCallbackArgument(string key, string value); + + /// <summary> /// Adds an OpenID extension to the request directed at the OpenID provider. /// </summary> /// <param name="extension">The initialized extension to add to the request.</param> |