当前位置: 首页>>代码示例>>C#>>正文


C# IServiceCollection.AddStormpath方法代码示例

本文整理汇总了C#中IServiceCollection.AddStormpath方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceCollection.AddStormpath方法的具体用法?C# IServiceCollection.AddStormpath怎么用?C# IServiceCollection.AddStormpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceCollection的用法示例。


在下文中一共展示了IServiceCollection.AddStormpath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add Stormpath services
            var stormpathConfiguration = new StormpathConfiguration()
            {
                Web = new WebConfiguration()
                {
                    ServerUri = "http://localhost:8080",
                    Login = new WebLoginRouteConfiguration()
                    //{
                    //    View = "~/Views/Stormpath/MyLogin.cshtml"
                    //}
                }
            };
            services.AddStormpath(stormpathConfiguration);

            // Configure authorization policies here, which can include Stormpath requirements.
            services.AddAuthorization(opt =>
            {
                opt.AddPolicy("CustomDataIT", policy => policy.AddRequirements(new StormpathCustomDataRequirement("testing", "rocks!")));
                opt.AddPolicy("AdminITGroup", policy => policy.AddRequirements(new StormpathGroupsRequirement("adminIT")));
            });

            // Add framework services.
            services.AddMvc();
        }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:27,代码来源:Startup.cs

示例2: ConfigureServices_CustomView

 public void ConfigureServices_CustomView(IServiceCollection services)
 {
     #region code/templates/aspnetcore/custom_view.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Login = new WebLoginRouteConfiguration
             {
                 View = "~/Views/Login/MyLogin.cshtml"
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:15,代码来源:Startup_ViewTemplates.cs

示例3: ConfigureServices_AnonymousModel

 public void ConfigureServices_AnonymousModel(IServiceCollection services)
 {
     #region code/configuration/aspnetcore/anonymous_inline_config.cs
     services.AddStormpath(new
     {
         application = new
         {
             name = "My Application"
         },
         web = new
         {
             register = new
             {
                 enabled = false
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:19,代码来源:Startup_Configuration.cs

示例4: ConfigureServices_Model

 public void ConfigureServices_Model(IServiceCollection services)
 {
     #region code/configuration/aspnetcore/inline_config.cs
     services.AddStormpath(new StormpathConfiguration()
     {
         Application = new ApplicationConfiguration()
         {
             Name = "My Application"
         },
         Web = new WebConfiguration()
         {
             Register = new WebRegisterRouteConfiguration()
             {
                 Enabled = false
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:19,代码来源:Startup_Configuration.cs

示例5: ConfigureServices_RegisterCustomFormField

 public void ConfigureServices_RegisterCustomFormField(IServiceCollection services)
 {
     #region code/registration/aspnetcore/configure_custom_form_field.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Register = new WebRegisterRouteConfiguration
             {
                 Form = new WebRegisterRouteFormConfiguration
                 {
                     Fields = new Dictionary<string, WebFieldConfiguration>
                     {
                         ["favoriteColor"] = new WebFieldConfiguration
                         {
                             Enabled = true,
                             Visible = true,
                             Label = "Favorite Color",
                             Placeholder = "e.g. red, blue",
                             Required = true,
                             Type = "text"
                         }
                     }
                 }
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:29,代码来源:Startup_Configuration.cs

示例6: ConfigureServices_RegisterFormFieldsRequired

 public void ConfigureServices_RegisterFormFieldsRequired(IServiceCollection services)
 {
     #region code/registration/aspnetcore/configure_form_fields_required.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Register = new WebRegisterRouteConfiguration
             {
                 Form = new WebRegisterRouteFormConfiguration
                 {
                     Fields = new Dictionary<string, WebFieldConfiguration>
                     {
                         ["givenName"] = new WebFieldConfiguration { Required = false },
                         ["surname"] = new WebFieldConfiguration { Required = false }
                     }
                 }
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:22,代码来源:Startup_Configuration.cs

示例7: ConfigureServices_RegisterUri

 public void ConfigureServices_RegisterUri(IServiceCollection services)
 {
     #region code/registration/aspnetcore/configure_uri.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Register = new WebRegisterRouteConfiguration
             {
                 Uri = "/createAccount"
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:15,代码来源:Startup_Configuration.cs

示例8: ConfigureServices_PasswordResetUris

 public void ConfigureServices_PasswordResetUris(IServiceCollection services)
 {
     #region code/password_reset/aspnetcore/configure_uris.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             ForgotPassword = new WebForgotPasswordRouteConfiguration
             {
                 Uri = "/forgot-password"
             },
             ChangePassword = new WebChangePasswordRouteConfiguration
             {
                 Uri = "/change-password"
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:19,代码来源:Startup_Configuration.cs

示例9: ConfigureServices_LogoutUris

 public void ConfigureServices_LogoutUris(IServiceCollection services)
 {
     #region code/logout/aspnetcore/configure_uris.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Logout = new WebLogoutRouteConfiguration
             {
                 Uri = "/logMeOut",
                 NextUri = "/goodbye"
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:16,代码来源:Startup_Configuration.cs

示例10: ConfigureServices_LoginChangeLabel

 public void ConfigureServices_LoginChangeLabel(IServiceCollection services)
 {
     #region code/login/aspnetcore/configure_labels.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Login = new WebLoginRouteConfiguration
             {
                 Form = new WebLoginRouteFormConfiguration
                 {
                     Fields = new Dictionary<string, WebFieldConfiguration>
                     {
                         ["login"] = new WebFieldConfiguration
                         {
                             Label = "Email",
                             Placeholder = "[email protected]"
                         },
                         ["password"] = new WebFieldConfiguration
                         {
                             Placeholder = "Tip: Use a strong password!"
                         }
                     }
                 }
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:29,代码来源:Startup_Configuration.cs

示例11: ConfigureServices_LoginUri

 public void ConfigureServices_LoginUri(IServiceCollection services)
 {
     #region code/login/aspnetcore/configure_uri.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Login = new WebLoginRouteConfiguration
             {
                 Uri = "/logMeIn"
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:15,代码来源:Startup_Configuration.cs

示例12: ConfigureServices_VerifyEmailUri

 public void ConfigureServices_VerifyEmailUri(IServiceCollection services)
 {
     #region code/email_verification/aspnetcore/configure_uri.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             VerifyEmail = new WebVerifyEmailRouteConfiguration
             {
                 Uri = "/verifyEmail"
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:15,代码来源:Startup_Configuration.cs

示例13: ConfigureServices_ServerUri

 public void ConfigureServices_ServerUri(IServiceCollection services)
 {
     #region code/configuration/aspnetcore/server_uri.cs
     services.AddStormpath(new StormpathConfiguration()
     {
         Web = new WebConfiguration()
         {
             ServerUri = "http://localhost:5000"
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:12,代码来源:Startup_Configuration.cs

示例14: ConfigureServices_DisableHtml

 public void ConfigureServices_DisableHtml(IServiceCollection services)
 {
     #region code/configuration/aspnetcore/disable_html_produces.cs
     services.AddStormpath(new StormpathConfiguration()
     {
         Web = new WebConfiguration()
         {
             Produces = new string[] { "application/json" }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:12,代码来源:Startup_Configuration.cs

示例15: ConfigureServices_RegisterFieldOrder

 public void ConfigureServices_RegisterFieldOrder(IServiceCollection services)
 {
     #region code/registration/aspnetcore/configure_field_order.cs
     services.AddStormpath(new StormpathConfiguration
     {
         Web = new WebConfiguration
         {
             Register = new WebRegisterRouteConfiguration
             {
                 Form = new WebRegisterRouteFormConfiguration
                 {
                     FieldOrder = new string[]
                     {
                         "surname",
                         "givenName",
                         "email",
                         "password"
                     }
                 }
             }
         }
     });
     #endregion
 }
开发者ID:stormpath,项目名称:stormpath-aspnetcore,代码行数:24,代码来源:Startup_Configuration.cs


注:本文中的IServiceCollection.AddStormpath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。