You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tutorial https://github.com/Synergex/HarmonyCore/wiki/Tutorial-03-01-Authentication-via-Custom-Code doesn’t work the way it seems it should. The problem is that the files listed in the first two bullets of the “What changed” section aren’t generated when I select the “Enable authentication” and “Enable Custom Auth” options in the GUI tool. Here are the first two bullets of that section:
A new source file named AuthenticationModels.dbl is generated into the root folder of the Services.Models project.
Two new source files, named AuthenticationController.dbl and AuthenticationTools.dbl, are generated into the root folder of the Services.Controllers project.
If “Enable authentication” and “Enable Custom Auth” are selected in the GUI tool, should the files listed in these two bullets be created?
The text was updated successfully, but these errors were encountered:
Matt found and fixed it but it will take a little bit before we're ready to do a real update with this in it. in the meantime you can place the following contents into a CustomOData.csx file in the Ganerators\Enabled folder of your solution. If you already have a customization for this generator you should be able to merge the two of them pretty easily.
public class CustomODataGenerator : ODataGenerator
{
public override void ApplyDefaults(Solution solution)
{
}
public override List<string> ValidateSolution(Solution solution)
{
return new List<string>();
}
public override List<CodeGenTask> GenerateTasks(Solution solution)
{
var baseTasks = base.GenerateTasks(solution);
if(solution.Authentication ?? false)
baseTasks.Add(StructureTaskHelper(solution, "Generate custom authentication", solution.ModelsNamespace, solution.ModelsFolder, true, nameof(ODataGenerator), new string[] { "ODataCustomAuthModels" }, null));
if(solution.CustomAuthentication ?? false)
baseTasks.Add(StructureTaskHelper(solution, "Generate custom authentication", solution.ControllersNamespace, solution.ControllersFolder, true, nameof(ODataGenerator), new string[] { "ODataCustomAuthController", "ODataCustomAuthTools" }, null));
return baseTasks;
}
}
new CustomODataGenerator()
Thanks Jeff, but just to confirm this does impact Traditional Bridge Authentication being enabled....correct? Just wanted to make sure it was not OData only.
When you enable authentication, {Authorize} is added to interface controller classes. But this particular update just adds the missing files (AuthenticationModels.dbl, AuthenticationController.dbl, and AuthenticationTools.dbl).
The tutorial https://github.com/Synergex/HarmonyCore/wiki/Tutorial-03-01-Authentication-via-Custom-Code doesn’t work the way it seems it should. The problem is that the files listed in the first two bullets of the “What changed” section aren’t generated when I select the “Enable authentication” and “Enable Custom Auth” options in the GUI tool. Here are the first two bullets of that section:
If “Enable authentication” and “Enable Custom Auth” are selected in the GUI tool, should the files listed in these two bullets be created?
The text was updated successfully, but these errors were encountered: