コード例 #1
0
        private static SwaggerOwinSettings ConfigureIdentity(this SwaggerOwinSettings settings, MyUrlsOptions urlOptions)
        {
            settings.DocumentProcessors.Add(
                new SecurityDefinitionAppender(Constants.SecurityDefinition, SwaggerHelper.CreateOAuthSchema(urlOptions)));

            settings.OperationProcessors.Add(new OperationSecurityScopeProcessor(Constants.SecurityDefinition));

            return(settings);
        }
コード例 #2
0
        public static SwaggerSettings <T> ConfigureIdentity <T>(this SwaggerSettings <T> settings, MyUrlsOptions urlOptions) where T : SwaggerGeneratorSettings, new()
        {
            settings.GeneratorSettings.DocumentProcessors.Add(
                new SecurityDefinitionAppender(
                    Constants.SecurityDefinition, SwaggerHelper.CreateOAuthSchema(urlOptions)));

            settings.GeneratorSettings.OperationProcessors.Add(new ScopesProcessor());

            return(settings);
        }
コード例 #3
0
 private void GenerateSecurityDefinitions()
 {
     document.SecurityDefinitions.Add("OAuth2", SwaggerHelper.CreateOAuthSchema(urlOptions));
 }