Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 4db9f1f

Browse files
committed
Renamed IAuthorizationServer to IAuthorizationServerHost.
To avoid confusion with the concrete class AuthorizationServer.
1 parent 35e747c commit 4db9f1f

15 files changed

Lines changed: 34 additions & 34 deletions

File tree

projecttemplates/RelyingPartyLogic/OAuthAuthorizationServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace RelyingPartyLogic {
2020
/// <summary>
2121
/// Provides OAuth 2.0 authorization server information to DotNetOpenAuth.
2222
/// </summary>
23-
public class OAuthAuthorizationServer : IAuthorizationServer {
23+
public class OAuthAuthorizationServer : IAuthorizationServerHost {
2424
private static readonly RSACryptoServiceProvider SigningKey = new RSACryptoServiceProvider();
2525

2626
private readonly INonceStore nonceStore = new NonceDbStore();
@@ -32,7 +32,7 @@ public OAuthAuthorizationServer() {
3232
this.CryptoKeyStore = new RelyingPartyApplicationDbStore();
3333
}
3434

35-
#region IAuthorizationServer Members
35+
#region IAuthorizationServerHost Members
3636

3737
public ICryptoKeyStore CryptoKeyStore { get; private set; }
3838

samples/OAuthAuthorizationServer/Code/OAuth2AuthorizationServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using DotNetOpenAuth.OAuth2.ChannelElements;
1111
using DotNetOpenAuth.OAuth2.Messages;
1212

13-
internal class OAuth2AuthorizationServer : IAuthorizationServer {
13+
internal class OAuth2AuthorizationServer : IAuthorizationServerHost {
1414
#if SAMPLESONLY
1515
/// <summary>
1616
/// This is the FOR SAMPLE ONLY hard-coded public key of the complementary OAuthResourceServer sample.
@@ -29,7 +29,7 @@ internal class OAuth2AuthorizationServer : IAuthorizationServer {
2929
private static readonly RSAParameters ResourceServerEncryptionPublicKey;
3030
#endif
3131

32-
#region Implementation of IAuthorizationServer
32+
#region Implementation of IAuthorizationServerHost
3333

3434
public ICryptoKeyStore CryptoKeyStore {
3535
get { return MvcApplication.KeyNonceStore; }

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthServerUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal static class AuthServerUtilities {
2323
/// <param name="authorizationServer">The authorization server.</param>
2424
/// <param name="clientIdentifier">The client identifier.</param>
2525
/// <returns>The client information. Never null.</returns>
26-
internal static IClientDescription GetClientOrThrow(this IAuthorizationServer authorizationServer, string clientIdentifier) {
26+
internal static IClientDescription GetClientOrThrow(this IAuthorizationServerHost authorizationServer, string clientIdentifier) {
2727
Requires.NotNullOrEmpty(clientIdentifier, "clientIdentifier");
2828
Contract.Ensures(Contract.Result<IClientDescription>() != null);
2929

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class AuthorizationServer {
2626
/// Initializes a new instance of the <see cref="AuthorizationServer"/> class.
2727
/// </summary>
2828
/// <param name="authorizationServer">The authorization server.</param>
29-
public AuthorizationServer(IAuthorizationServer authorizationServer) {
29+
public AuthorizationServer(IAuthorizationServerHost authorizationServer) {
3030
Requires.NotNull(authorizationServer, "authorizationServer");
3131
this.Channel = new OAuth2AuthorizationServerChannel(authorizationServer);
3232
}
@@ -41,7 +41,7 @@ public AuthorizationServer(IAuthorizationServer authorizationServer) {
4141
/// Gets the authorization server.
4242
/// </summary>
4343
/// <value>The authorization server.</value>
44-
public IAuthorizationServer AuthorizationServerServices {
44+
public IAuthorizationServerHost AuthorizationServerServices {
4545
get { return ((IOAuth2ChannelWithAuthorizationServer)this.Channel).AuthorizationServer; }
4646
}
4747

@@ -112,7 +112,7 @@ public OutgoingWebResponse HandleTokenRequest(HttpRequestBase request = null) {
112112
if (this.Channel.TryReadFromRequest(request, out requestMessage)) {
113113
IAccessTokenRequestInternal accessRequestInternal = requestMessage;
114114
accessRequestInternal.AccessTokenCreationParameters = this.AuthorizationServerServices.GetAccessTokenParameters(requestMessage);
115-
ErrorUtilities.VerifyHost(accessRequestInternal.AccessTokenCreationParameters != null, "IAuthorizationServer.GetAccessTokenParameters must not return null.");
115+
ErrorUtilities.VerifyHost(accessRequestInternal.AccessTokenCreationParameters != null, "IAuthorizationServerHost.GetAccessTokenParameters must not return null.");
116116

117117
var successResponseMessage = this.PrepareAccessTokenResponse(requestMessage, accessRequestInternal.AccessTokenCreationParameters.IncludeRefreshToken);
118118
successResponseMessage.Lifetime = accessRequestInternal.AccessTokenCreationParameters.AccessTokenLifetime;

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/AuthServerBindingElementBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected AuthServerBindingElementBase() {
4141
/// Gets the authorization server hosting this channel.
4242
/// </summary>
4343
/// <value>The authorization server.</value>
44-
protected IAuthorizationServer AuthorizationServer {
44+
protected IAuthorizationServerHost AuthorizationServer {
4545
get { return ((IOAuth2ChannelWithAuthorizationServer)this.Channel).AuthorizationServer; }
4646
}
4747

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/AuthorizationCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ internal static TimeSpan MaximumMessageAge {
6565
/// </summary>
6666
/// <param name="authorizationServer">The authorization server that will be serializing/deserializing this authorization code. Must not be null.</param>
6767
/// <returns>A DataBag formatter.</returns>
68-
internal static IDataBagFormatter<AuthorizationCode> CreateFormatter(IAuthorizationServer authorizationServer) {
68+
internal static IDataBagFormatter<AuthorizationCode> CreateFormatter(IAuthorizationServerHost authorizationServer) {
6969
Requires.NotNull(authorizationServer, "authorizationServer");
7070
Contract.Ensures(Contract.Result<IDataBagFormatter<AuthorizationCode>>() != null);
7171

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/IOAuth2ChannelWithAuthorizationServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ internal interface IOAuth2ChannelWithAuthorizationServer {
1414
/// Gets the authorization server.
1515
/// </summary>
1616
/// <value>The authorization server.</value>
17-
IAuthorizationServer AuthorizationServer { get; }
17+
IAuthorizationServerHost AuthorizationServer { get; }
1818
}
1919
}

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public override MessageProtections Protection {
146146

147147
// Make sure the authorization this token represents hasn't already been revoked.
148148
if (!this.AuthorizationServer.IsAuthorizationValid(authCarrier.AuthorizationDescription)) {
149-
Logger.OAuth.Error("Rejecting access token request because the IAuthorizationServer.IsAuthorizationValid method returned false.");
149+
Logger.OAuth.Error("Rejecting access token request because the IAuthorizationServerHost.IsAuthorizationValid method returned false.");
150150
throw new TokenEndpointProtocolException(Protocol.AccessTokenRequestErrorCodes.InvalidGrant);
151151
}
152152

src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal class OAuth2AuthorizationServerChannel : OAuth2ChannelBase, IOAuth2Chan
3535
/// Initializes a new instance of the <see cref="OAuth2AuthorizationServerChannel"/> class.
3636
/// </summary>
3737
/// <param name="authorizationServer">The authorization server.</param>
38-
protected internal OAuth2AuthorizationServerChannel(IAuthorizationServer authorizationServer)
38+
protected internal OAuth2AuthorizationServerChannel(IAuthorizationServerHost authorizationServer)
3939
: base(MessageTypes, InitializeBindingElements(authorizationServer)) {
4040
Requires.NotNull(authorizationServer, "authorizationServer");
4141
this.AuthorizationServer = authorizationServer;
@@ -45,7 +45,7 @@ protected internal OAuth2AuthorizationServerChannel(IAuthorizationServer authori
4545
/// Gets the authorization server.
4646
/// </summary>
4747
/// <value>The authorization server.</value>
48-
public IAuthorizationServer AuthorizationServer { get; private set; }
48+
public IAuthorizationServerHost AuthorizationServer { get; private set; }
4949

5050
/// <summary>
5151
/// Gets the protocol message that may be in the given HTTP response.
@@ -109,7 +109,7 @@ protected override IDirectedProtocolMessage ReadFromRequestCore(HttpRequestBase
109109
/// <returns>
110110
/// An array of binding elements used to initialize the channel.
111111
/// </returns>
112-
private static IChannelBindingElement[] InitializeBindingElements(IAuthorizationServer authorizationServer) {
112+
private static IChannelBindingElement[] InitializeBindingElements(IAuthorizationServerHost authorizationServer) {
113113
Requires.NotNull(authorizationServer, "authorizationServer");
114114
var bindingElements = new List<IChannelBindingElement>();
115115

src/DotNetOpenAuth.OAuth2.ClientAuthorization/DotNetOpenAuth.OAuth2.ClientAuthorization.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<DependentUpon>ClientAuthorizationStrings.resx</DependentUpon>
2929
</Compile>
3030
<Compile Include="OAuth2\ClientType.cs" />
31-
<Compile Include="OAuth2\IAuthorizationServer.cs" />
31+
<Compile Include="OAuth2\IAuthorizationServerHost.cs" />
3232
<Compile Include="OAuth2\IClientDescription.cs" />
3333
<Compile Include="OAuth2\Messages\AccessTokenAuthorizationCodeRequest.cs" />
3434
<Compile Include="OAuth2\Messages\AccessTokenClientCredentialsRequest.cs" />

0 commit comments

Comments
 (0)