summaryrefslogtreecommitdiffstats
path: root/samples/ServiceProvider
diff options
context:
space:
mode:
Diffstat (limited to 'samples/ServiceProvider')
-rw-r--r--samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs2
-rw-r--r--samples/ServiceProvider/Members/Authorize.aspx.cs4
-rw-r--r--samples/ServiceProvider/OAuth.ashx6
3 files changed, 7 insertions, 5 deletions
diff --git a/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs b/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
index 02118f8..9d2e3e9 100644
--- a/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
+++ b/samples/ServiceProvider/App_Code/OAuthAuthorizationManager.cs
@@ -19,7 +19,7 @@ public class OAuthAuthorizationManager : ServiceAuthorizationManager {
HttpRequestMessageProperty httpDetails = operationContext.RequestContext.RequestMessage.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
Uri requestUri = operationContext.RequestContext.RequestMessage.Properties["OriginalHttpRequestUri"] as Uri;
ServiceProvider sp = Constants.CreateServiceProvider();
- var auth = sp.GetProtectedResourceAuthorization(httpDetails, requestUri);
+ var auth = sp.ReadProtectedResourceAuthorization(httpDetails, requestUri);
if (auth != null) {
var accessToken = Global.DataContext.OAuthTokens.Single(token => token.Token == auth.AccessToken);
diff --git a/samples/ServiceProvider/Members/Authorize.aspx.cs b/samples/ServiceProvider/Members/Authorize.aspx.cs
index 676e5ce..9285df3 100644
--- a/samples/ServiceProvider/Members/Authorize.aspx.cs
+++ b/samples/ServiceProvider/Members/Authorize.aspx.cs
@@ -29,9 +29,9 @@ public partial class Authorize : System.Web.UI.Page {
multiView.ActiveViewIndex = 1;
ServiceProvider sp = new ServiceProvider(Constants.SelfDescription, Global.TokenManager);
- var response = sp.SendAuthorizationResponse(pending);
+ var response = sp.PrepareAuthorizationResponse(pending);
if (response != null) {
- response.Send();
+ sp.Channel.Send(response).Send();
}
}
diff --git a/samples/ServiceProvider/OAuth.ashx b/samples/ServiceProvider/OAuth.ashx
index 91a53f5..6de26ef 100644
--- a/samples/ServiceProvider/OAuth.ashx
+++ b/samples/ServiceProvider/OAuth.ashx
@@ -22,12 +22,14 @@ public class OAuth : IHttpHandler, IRequiresSessionState {
DirectUserToServiceProviderMessage requestAuth;
GetAccessTokenMessage requestAccessToken;
if ((requestToken = request as RequestScopedTokenMessage) != null) {
- sp.SendUnauthorizedTokenResponse(requestToken, null).Send();
+ var response = sp.PrepareUnauthorizedTokenMessage(requestToken);
+ sp.Channel.Send(response).Send();
} else if ((requestAuth = request as DirectUserToServiceProviderMessage) != null) {
Global.PendingOAuthAuthorization = requestAuth;
HttpContext.Current.Response.Redirect("~/Members/Authorize.aspx");
} else if ((requestAccessToken = request as GetAccessTokenMessage) != null) {
- sp.SendAccessToken(requestAccessToken, null).Send();
+ var response = sp.PrepareAccessTokenMessage(requestAccessToken);
+ sp.Channel.Send(response).Send();
} else {
throw new InvalidOperationException();
}