Skip to content

Commit 659a52c

Browse files
authored
Update README.md
Readability improvements Signed-off-by: Joachim Fosse <56757601+joaf123@users.noreply.github.com>
1 parent 6ddd5bf commit 659a52c

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Verify FormsAuthentication cookie on request through custom attribute
2-
httpModule for verification of FormsAuthentication cookie on request, using a custom attribute.
32

4-
## Currently supported use cases:
3+
> httpModule for FormsAuthentication verification on requests using custom attributes.
54
6-
### C#:
75

8-
#### Decorated on a PageMethod or ASP.NET Ajax WebMethod:
6+
7+
## Currently supported use cases - C#:
8+
9+
### Decorated on spesific PageMethod's or Ajax WebMethod's:
910

1011
```csharp
1112
[RequiresAuthentication]
@@ -14,18 +15,17 @@ public string AjaxMethod() {
1415
```
1516

1617

17-
#### Decorated on a Page, MasterPage or ASP.NET Ajax WebService Class:
18-
##### Page Class:
18+
### Decorated on Page Class:
1919
```csharp
2020
[RequiresAuthentication]
2121
public partial class WebFormsPage : System.Web.UI.Page
2222
```
23-
##### MasterPage Class:
23+
### Decorated on MasterPage Class:
2424
```csharp
2525
[RequiresAuthentication]
2626
public partial class WebFormsMasterPage : System.Web.UI.MasterPage
2727
```
28-
##### WebService Class:
28+
### Decorated on WebService Class:
2929
```csharp
3030
[RequiresAuthentication]
3131
[System.Web.Script.Services.ScriptService()]
@@ -39,31 +39,30 @@ public class AspAjaxWebService : System.Web.Services.WebService
3939

4040
---
4141

42-
### VB:
42+
## Currently supported use cases - VB.NET:
4343

44-
#### Decorated on a PageMethod or ASP.NET Ajax WebMethod:
44+
### Decorated on spesific PageMethod's or Ajax WebMethod's:
4545
```vb
4646
<RequiresAuthentication>
4747
<WebMethod>
4848
public function AjaxMethod() as string
4949
```
5050

51-
#### Decorated on a Page, MasterPage or ASP.NET Ajax WebService Class
52-
##### Page Class:
51+
### Decorated on Page Class:
5352
```vb
5453
<RequiresAuthentication>
5554
Partial Class WebFormsPage
5655
Inherits System.Web.UI.Page
5756
```
5857

59-
##### MasterPage Class:
58+
### Decorated on MasterPage Class:
6059
```vb
6160
<RequiresAuthentication>
6261
Partial Class WebFormsMasterPage
6362
Inherits System.Web.UI.MasterPage
6463
```
6564

66-
##### WebService Class:
65+
### Decorated on WebService Class:
6766
```vb
6867
<RequiresAuthentication>
6968
<System.Web.Script.Services.ScriptService()>
@@ -76,4 +75,15 @@ End Class
7675
```
7776

7877
<br/>
79-
Remember to set the FormsAuthentication cookie!
78+
79+
---
80+
81+
## DO NOT FORGET BEFORE USING:
82+
83+
* Make sure your FormsAuthentication cookie is set correctly
84+
* Verify/change the assembly metadata for System.Web.Extensions which is used to get the Type definition for RestHandlerWithSession:
85+
```csharp
86+
Type _RestHandlerWithSessionType = Type.GetType("System.Web.Script.Services.RestHandlerWithSession, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
87+
88+
// the "Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" part must match YOUR spesific scenario
89+
```

0 commit comments

Comments
 (0)