Skip to content

Release/2.0 #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions build/ActiveDirectory.Readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_ _ __ __ ____ _____ _____ ____
_ _ __ __ ____ _____ _____ ____
| | | | \/ | _ \| __ \ /\ / ____/ __ \
| | | | \ / | |_) | |__) | / \ | | | | | |
| | | | |\/| | _ <| _ / / /\ \| | | | | |
Expand All @@ -17,9 +17,10 @@ for ASP.Net Identity for the Umbraco back office.

The usage of this extension method in your OWIN startup class will look like this:

app.ConfigureBackOfficeAzureActiveDirectoryAuth(
app.ConfigureBackOfficeAzureActiveDirectoryAuthentication(
"YOUR_TENANT",
"YOUR_CLIENT_ID",
"YOUR_CLIENT_SECRET",
"YOUR_POST_LOGIN_REDIRECT_URL",
new System.Guid("ISSUER_ID"));

Expand All @@ -41,4 +42,4 @@ following files for full details:
Identity implementation for back office users as well as
snippets to enable 3rd party ASP.Net Identity providers to work.
To enable the 'UmbracoCustomOwinStartup', update the web.config
appSetting "owin:appStartup" to be: "UmbracoCustomOwinStartup"
appSetting "owin:appStartup" to be: "UmbracoCustomOwinStartup"
24 changes: 19 additions & 5 deletions src/App_Start/UmbracoADAuthExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public static class UmbracoADAuthExtensions
/// ActiveDirectory account documentation for ASP.Net Identity can be found:
/// https://github.com/AzureADSamples/WebApp-WebAPI-OpenIDConnect-DotNet
/// </remarks>
public static void ConfigureBackOfficeAzureActiveDirectoryAuth(this IAppBuilder app,
string tenant, string clientId, string postLoginRedirectUri, Guid issuerId,
public static void ConfigureBackOfficeAzureActiveDirectoryAuthentication(this IAppBuilder app,
string tenant, string clientId, string clientSecret, string postLoginRedirectUri, Guid issuerId,
string caption = "Active Directory", string style = "btn-microsoft", string icon = "fa-windows")
{
var authority = string.Format(
Expand All @@ -60,17 +60,31 @@ public static void ConfigureBackOfficeAzureActiveDirectoryAuth(this IAppBuilder
Authority = authority,
RedirectUri = postLoginRedirectUri
};
if (clientSecret != null)
adOptions.ClientSecret=clientSecret;

adOptions.ForUmbracoBackOffice(style, icon);
adOptions.Caption = caption;
//Need to set the auth tyep as the issuer path
//Need to set the auth type as the issuer path
adOptions.AuthenticationType = string.Format(
CultureInfo.InvariantCulture,
"https://sts.windows.net/{0}/",
issuerId);
app.UseOpenIdConnectAuthentication(adOptions);
}
}

[Obsolete("ConfigureBackOfficeAzureActiveDirectoryAuth has been deprecated , Please use ConfigureBackOfficeAzureActiveDirectoryAuthentication with clientSecret instead!")]
public static void ConfigureBackOfficeAzureActiveDirectoryAuth(this IAppBuilder app,
string tenant, string clientId, string postLoginRedirectUri, Guid issuerId,
string caption = "Active Directory", string style = "btn-microsoft", string icon = "fa-windows")
{
ConfigureBackOfficeAzureActiveDirectoryAuthentication(app,tenant,clientId,null,
postLoginRedirectUri,issuerId,
caption,style,icon);
}

}



}
}
10 changes: 5 additions & 5 deletions src/Umbraco.IdentityExtensions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Umbraco.Identity")]
Expand All @@ -13,15 +13,15 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("298754bc-c384-4195-9094-24940c569e6a")]

[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("2.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: AssemblyFileVersion("2.0.1")]
[assembly: AssemblyInformationalVersion("2.0.1")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2019")]