Exemplo n.º 1
0
        public static void ConfigureAuth(this SwaggerUIOptions options, AppInfo appInfo,
                                         AuthenticationInfo authentication)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (authentication == null)
            {
                throw new ArgumentNullException(nameof(authentication));
            }

            options.OAuthClientId(authentication.Audience);
            options.OAuthAppName(appInfo.Name);
            options.OAuthAdditionalQueryStringParams(new Dictionary <string, string>
            {
                { "resource", authentication.Audience }
            });
        }