This is a simple "Hello, world" guide to getting started as a Service Provider with OpenAthens using .NET.
Before you begin you will need:
- An OpenAthens customer domain and access to the OpenAthens admin area (https://admin.openathens.net)
- An OpenAthens personal account under that customer domain for testing (in the OpenAthens admin area go to Accounts > Add > Personal)
- The EntityID for your domain - this can be found in the OpenAthens admin area under Management > Connections
- Access to a .NET environment running IIS (we are assuming local machine for this guide)
- $ATACAMA_HOME is
C:\Program Files (x86)Eduserv\OpenAthens.Net
- Application pool Managed Pipeline Mode is in 'Integrated' mode and 'Enable 32-Bit applications' is set to true in Advanced Settings.
What are we going to do
Create the application in the OpenAthens publisher dashboard
Go to https://sp.openathens.net, sign in and follow these steps:
- Click the register new application button and choose OpenAthens SP in the dialogue box
- Name your application. In the real world this would will be customer facing, but for now it can be anything
- Application URL: this is the root web address of the application - e.g:
- Leave 'users in my domain' ticked, but keep the other options unticked
- Click the create button. This creates the application record and a connection
At this point you're presented with a getting started guide in the dashboard that should provide you with enough to implement OpenAthens SP on your .NET Web application.
Any basic .NET application page will do for this - e.g. after creating a relevant folder under
- File: New Project -> Visual C# - ASP.NET Web Application -> Give it a name and click OK (leave the 'Create directory for solution' checkbox selected).
- Create a new page to protect: right-click on the project name from the Solution Explorer and select Add -> New Item.
- Ensure ‘Web’ is selected from the ‘Installed Templates’ menu, then select ‘Web Form’ from the central menu.
- Rename the file to be '
ProtectedPage.aspx’ and click the ‘Add’ button.
- Paste the following code into
Now add the OpenAthens bits to the Web.config
From the Solution Explorer double-click on the file Web.config and paste this in, updating the OpenAthens configuration URL and Access Key on the line near the end:
- Publish to IIS
- Edit > Publish Profiles.
- Ensure the Publish method is set to
- 'File system' (testing on local machine).
- Target Location is the folder you created under
- leave 'Replace matching files with local copies' selected. Click Publish
- Restart IIS
Visit your protected page in a browser and you should be redirected to OpenAthens.
Log in with the personal account you created and you should be logged in.
At the moment your service provider is only connected to your customer domain. For very small applications that may be all you need, but it is more likely you'll want to join the federation as soon as possible and for that you will need to production ready.