Example #1
0
 public WebUI(IAuthorizationParameters parameters)
 {
     this.parameters = parameters as AuthorizationParameters;
     if (this.parameters == null)
     {
         throw new ArgumentException("parameters should be of type AuthorizationParameters", "parameters");
     }
 }
Example #2
0
 public CartItemService(
     StoreContext context,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <CartItem> authoriationParameters,
     IAppLogger <Service <CartItem> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
 }
 public ItemVariantService(
     StoreContext context,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <ItemVariant> authoriationParameters,
     IAppLogger <Service <ItemVariant> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
 }
 public ImageService(
     StoreContext context,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <TImage> authoriationParameters,
     IConfiguration configuration,
     IAppLogger <Service <TImage> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, configuration, logger)
 {
 }
 public StoresController(
     IStoreService storeService,
     IActivatorService activatorService,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <Store> authoriationParameters,
     IAppLogger <IController <Store, StoreViewModel> > logger)
     : base(storeService, activatorService, identityService, scopedParameters, logger)
 {
     AuthorziationParameters = authoriationParameters;
 }
 public CharacteristicService(
     StoreContext context,
     IIdentityService identityService,
     ICategoryService categoryService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <Characteristic> authoriationParameters,
     IAppLogger <Service <Characteristic> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
     _categoryService = categoryService;
 }
 public StoreService(
     StoreContext context,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IItemService itemService,
     IAuthorizationParameters <Store> authoriationParameters,
     IAppLogger <Service <Store> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
     _itemService = itemService;
 }
 public FileInfoService(
     StoreContext context,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <TFileInfo> authoriationParameters,
     IConfiguration configuration,
     IAppLogger <Service <TFileInfo> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
     Name           = typeof(TFileInfo).Name + "FileDetailService";
     _configuration = configuration;
     _rootPath      = Path.Combine(configuration.GetValue <string>(WebHostDefaults.ContentRootKey), "files");
 }
Example #9
0
 public ItemService(
     StoreContext context,
     IIdentityService identityService,
     IItemVariantImageService itemVariantImageService,
     ICategoryService categoryService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <Item> authoriationParameters,
     IAppLogger <Service <Item> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
     _itemVariantImageService = itemVariantImageService;
     _categoryService         = categoryService;
 }
Example #10
0
 public ItemPropertyService(
     StoreContext context,
     IIdentityService identityService,
     ICharacteristicValueService characteristicValueService,
     IScopedParameters scopedParameters,
     IItemVariantService itemVariantService,
     IAuthorizationParameters <ItemProperty> authoriationParameters,
     IAppLogger <Service <ItemProperty> > logger)
     : base(context, identityService, scopedParameters, authoriationParameters, logger)
 {
     _itemVariantService         = itemVariantService;
     _characteristicValueService = characteristicValueService;
 }
Example #11
0
 public Service(
     DbContext context,
     IIdentityService identityService,
     IScopedParameters scopedParameters,
     IAuthorizationParameters <TEntity> authoriationParameters,
     IAppLogger <Service <TEntity> > logger)
 {
     _сontext                = context;
     _scopedParameters       = scopedParameters;
     _authoriationParameters = authoriationParameters;
     _identityService        = identityService;
     _logger = logger;
     Name    = typeof(TEntity).Name + "Service";
 }
        public AcquireTokenInteractiveHandler(Authenticator authenticator, TokenCache tokenCache, string resource, string clientId, Uri redirectUri, IAuthorizationParameters parameters, UserIdentifier userId, string extraQueryParameters, IWebUI webUI, bool callSync)
            : base(authenticator, tokenCache, resource, new ClientKey(clientId), TokenSubjectType.User, callSync)
        {
            this.redirectUri = PlatformPlugin.PlatformInformation.ValidateRedirectUri(redirectUri, this.CallState);

            if (!string.IsNullOrWhiteSpace(this.redirectUri.Fragment))
            {
                var ex = new ArgumentException(AdalErrorMessage.RedirectUriContainsFragment, "redirectUri");
                PlatformPlugin.Logger.LogException(this.CallState, ex);
                throw ex;
            }

            this.authorizationParameters = parameters;

            this.redirectUriRequestParameter = PlatformPlugin.PlatformInformation.GetRedirectUriAsString(this.redirectUri, this.CallState);

            if (userId == null)
            {
                var ex = new ArgumentNullException("userId", AdalErrorMessage.SpecifyAnyUser);
                PlatformPlugin.Logger.LogException(this.CallState, ex);
                throw ex;
            }

            this.userId = userId;

            if (!string.IsNullOrEmpty(extraQueryParameters) && extraQueryParameters[0] == '&')
            {
                extraQueryParameters = extraQueryParameters.Substring(1);
            }

            this.extraQueryParameters = extraQueryParameters;

            this.webUi = webUI;

            this.UniqueId           = userId.UniqueId;
            this.DisplayableId      = userId.DisplayableId;
            this.UserIdentifierType = userId.Type;

            this.LoadFromCache = (tokenCache != null && parameters != null && PlatformPlugin.PlatformInformation.GetCacheLoadPolicy(parameters));

            this.SupportADFS = true;
        }
 /// <summary>
 /// Acquires security token from the authority.
 /// </summary>
 /// <param name="resource">Identifier of the target resource that is the recipient of the requested token.</param>
 /// <param name="clientId">Identifier of the client requesting the token.</param>
 /// <param name="redirectUri">Address to return to upon receiving a response from the authority.</param>
 /// <param name="userId">Identifier of the user token is requested for. If created from DisplayableId, this parameter will be used to pre-populate the username field in the authentication form. Please note that the end user can still edit the username field and authenticate as a different user.
 /// If you want to be notified of such change with an exception, create UserIdentifier with type RequiredDisplayableId. This parameter can be <see cref="UserIdentifier"/>.Any.</param>
 /// <param name="parameters">Parameters needed for interactive flow requesting authorization code. Pass an instance of AuthorizationParameters.</param>
 /// <param name="extraQueryParameters">This parameter will be appended as is to the query string in the HTTP authentication request to the authority. The parameter can be null.</param>
 /// <returns>It contains Access Token, Refresh Token and the Access Token's expiration time.</returns>
 public Task <AuthenticationResult> AcquireTokenAsync(string resource, string clientId, Uri redirectUri, IAuthorizationParameters parameters, UserIdentifier userId, string extraQueryParameters)
 {
     return(this.AcquireTokenCommonAsync(resource, clientId, redirectUri, parameters, userId: userId, extraQueryParameters: extraQueryParameters, callSync: true));
 }
 public virtual bool GetCacheLoadPolicy(IAuthorizationParameters parameters)
 {
     return(true);
 }
 public virtual void AddPromptBehaviorQueryParameter(IAuthorizationParameters parameters, RequestParameters authorizationRequestParameters)
 {
     authorizationRequestParameters[OAuthParameter.Prompt] = PromptValue.Login;
 }
 internal IWebUI CreateWebAuthenticationDialog(IAuthorizationParameters parameters)
 {
     return(PlatformPlugin.WebUIFactory.CreateAuthenticationDialog(parameters));
 }
        private async Task <AuthenticationResult> AcquireTokenCommonAsync(string resource, string clientId, Uri redirectUri, IAuthorizationParameters parameters, UserIdentifier userId, string extraQueryParameters = null, bool callSync = false)
        {
            var handler = new AcquireTokenInteractiveHandler(this.Authenticator, this.TokenCache, resource, clientId, redirectUri, parameters, userId, extraQueryParameters, this.CreateWebAuthenticationDialog(parameters), callSync);

            return(await handler.RunAsync());
        }
Example #18
0
 public IWebUI CreateAuthenticationDialog(IAuthorizationParameters parameters)
 {
     return(new WebUI(parameters));
 }