Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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: https://sp.yourdomain.com
  • 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.

...

  • File: New Project -> Visual C# - ASP.NET Web Application -> Give it a name and click OK (leave the 'Create directory for solution' checkbox tickedselected).
  • 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 ProtectedPage.aspx and save:

...

Code Block
<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <section name="openAthens" type="Eduserv.OpenAthens.OpenAthensConfigSection"/>
  </configSections>

  <connectionStrings>
   
 <add name="ApplicationServices" connectionString="data 
source=.\SQLEXPRESS;Integrated 
Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User 
Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="atacama.net, Version=2.1.3.0, Culture=neutral, PublicKeyToken=6E679382149F5665"/>
        <add assembly="OpenAthens.Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=17390934318F9B06"/>
      </assemblies>
    </compilation>
    <!-- <authentication mode="Windows"/> -->
    <authentication mode="None"/>
    <httpModules>
      <!--  <add name="OpenAthensServerModule" type="Eduserv.OpenAthens.ServerModule"/>-->
    </httpModules>
    <membership>
      <providers>
        <clear/>
       
 <add name="AspNetSqlMembershipProvider" 
type="System.Web.Security.SqlMembershipProvider" 
connectionStringName="ApplicationServices" 
enablePasswordRetrieval="false" enablePasswordReset="true" 
requiresQuestionAndAnswer="false" requiresUniqueEmail="false" 
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" 
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" 
applicationName="/"/>
      </providers>
    </membership>
    <profile>
      <providers>
        <clear/>
       
 <add name="AspNetSqlProfileProvider" 
type="System.Web.Profile.SqlProfileProvider" 
connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear/>
       
 <add name="AspNetSqlRoleProvider" 
type="System.Web.Security.SqlRoleProvider" 
connectionStringName="ApplicationServices" applicationName="/"/>
       
 <add name="AspNetWindowsTokenRoleProvider" 
type="System.Web.Security.WindowsTokenRoleProvider" 
applicationName="/"/>
      </providers>
    </roleManager>
  </system.web>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="OpenAthensServerModule" type="Eduserv.OpenAthens.ServerModule"/>
    </modules>
    <httpErrors errorMode="Detailed"/>
  </system.webServer>

<!--
	ATTENTION! AWOOGA! AUFMERKSAMKEIT! SYLW! ETC... 
	UPDATE THE CONFIGURATION URL AND ACCESS KEY IN THE NEXT BIT.
	DATA IN PUBLISHER DASHBOARD > APPLICATIONS > CONFIGURATION TAB
 -->
 
  <openAthens atacamaConfig="<insert configuration URL>" accessKey="<insert accessKey>" logConfig="C:\Program Files (x86)\Eduserv\OpenAthens.Net\conf\defaultLogConfig.xml"/>

  <location path="ProtectedPage.aspx">
    <openAthens>
      <authentication enabled="true"/>
    </openAthens>
    <system.web>
      <authorization>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
</configuration>

...


  • 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 C:\inetpub\wwwroot\
      • leave 'Replace matching files with local copies' selected. Click Publish
  • Restart IIS

...

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 get production ready.