Skip to content

Commit

Permalink
Bump version 2.0.1 to 2.0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
giladreich committed Jul 3, 2018
1 parent b7e0794 commit 4efa82f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ curl -I "https://apps.ihk-berlin.de/tibrosBB/BB_auszubildende.jsp"
curl -I "https://apps.ihk-berlin.de/favicon.ico"
```

At this point, the server has sent us 2 cookies that we'll to include in the header of the POST request when we posting the login form(Note that the order of the cookies is important):
At this point, the server has sent us 2 cookies that we'll need to include in the header of the POST request when we posting the login form(Note that the order of the cookies is important):
```sh
// Where REPLACEME_*, add the appropriate information:
curl -v -X POST "https://apps.ihk-berlin.de/tibrosBB/azubiHome.jsp" -H "Cookie: TSESSIONID=REPLACEME_SESSION1; TSESSIONID=REPLACEME_SESSION2" -d "login=REPLACEME_USER&pass=REPLACEME_PASS&anmelden="
curl -v -X POST "https://apps.ihk-berlin.de/tibrosBB/azubiHome.jsp"
-H "Cookie: TSESSIONID=REPLACEME_SESSION1; TSESSIONID=REPLACEME_SESSION2"
-d "login=REPLACEME_USER&pass=REPLACEME_PASS&anmelden="
```

NOTE: If the server has accepted our POST request and successfully identified us, it will send us back a new cookie as response, otherwise, we get no cookie back. <br/>
Expand All @@ -28,21 +30,23 @@ We'll treat the new cookie from the response as `REPLACEME_SESSION3`(you'll see
Now that we're logged in, the next step is to try and access some of the user's pages that requires authentication and see if we get OK from the server.

For our purpose, we need to retrieve the exam results page, which is `azubiErgebnisse.jsp?id=1`, but here it's get a little bit tricky, as if we try directly visiting
the results page, without first visiting the `azubiErgebnisse.jsp`, then the server will destroy our session and log us out automatically.
The way to access the results page, we use the following commands:
the results page, without first visiting the `azubiErgebnisse.jsp`, the server will destroy our session and log us out automatically.
The way to access the results page, we use the following commands in the following order:
```sh
// Simulate a visit in order to let the server confirm that we visited this page before we go any further:
curl "https://apps.ihk-berlin.de/tibrosBB/azubiPruef.jsp" -H "Cookie: TSESSIONID=REPLACEME_SESSION3; TSESSIONID=REPLACEME_SESSION2"
curl "https://apps.ihk-berlin.de/tibrosBB/azubiPruef.jsp"
-H "Cookie: TSESSIONID=REPLACEME_SESSION3; TSESSIONID=REPLACEME_SESSION2"

// Now we are safe to visit here and get what we wanted:
curl "https://apps.ihk-berlin.de/tibrosBB/azubiErgebnisse.jsp?id=1" -H "Cookie: TSESSIONID=REPLACEME_SESSION3; TSESSIONID=REPLACEME_SESSION2"
curl "https://apps.ihk-berlin.de/tibrosBB/azubiErgebnisse.jsp?id=1"
-H "Cookie: TSESSIONID=REPLACEME_SESSION3; TSESSIONID=REPLACEME_SESSION2"
```

Note that now every request we send, we always including the 2 cookies in the request-header for any type of request, because that's how the server identifies our session and the user that is currently authenticated.<br/>
Note that now every request we send, we always including the 2 cookies in the request-header for any type of request, because that's how the server identifies our login-session and that the user that is currently authenticated.<br/>

Also note that this can be easily done by creating a cookie jar: `curl --cookie-jar` or `curl -c`, but to have a better understanding I show the request commands the manual way.
Also note that this can be easily done by creating a cookie jar: `curl --cookie-jar` or `curl -c`, but to have a better understanding I show the process the manual way.

In C# we simply bind a `CookieContainer` to an `HttpClientHandler` that will be used in `HttpClient` and it saves us the trouble :)
In C# we simply bind a `CookieContainer` to an `HttpClientHandler` that will be used in `HttpClient` and it saves us all this trouble, but we still need to visit the pages in the right order :)



Expand Down
2 changes: 1 addition & 1 deletion src/IHK.ResultsNotifier/IHK.ResultsNotifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectGuid>{B717B701-620D-4714-8E9B-8963BF433CDE}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>IHK.ResultsNotifier</RootNamespace>
<AssemblyName>IHK-ResultsNotifier-v2.0.1</AssemblyName>
<AssemblyName>IHK-ResultsNotifier-v2.0.2</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
4 changes: 2 additions & 2 deletions src/IHK.ResultsNotifier/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.2.0")]

0 comments on commit 4efa82f

Please sign in to comment.