Beispiel #1
0
        public AuthenticationPageViewModel(INavigationService navigationService, IPermissionService permissionService,
                                           IStringLocalizer <AuthenticationPageViewModel> localizer, IApiAuthentication apiAuthentication,
                                           INotificationService notificationService)
            : base(navigationService, permissionService, localizer)
        {
            NavigationService   = navigationService;
            ApiAuthentication   = apiAuthentication;
            NotificationService = notificationService;

            ApiAuthentication.Authenticated += (sender, args) =>
            {
                Device.BeginInvokeOnMainThread(async() =>
                {
                    await NavigationService.GoBackAsync();

                    // TODO: LocalizationService
                    NotificationService.Notify("Login successful");
                });
            };

            // TODO: LocalizationService
            Title = "Login";

            AuthenticateWithGeoWikiCommand = new DelegateCommand(() => { ApiAuthentication.AuthenticateWithGeoWiki(); });

            AuthenticateWithGoogleCommand = new DelegateCommand(() => { ApiAuthentication.AuthenticateWithGoogle(); });

            AuthenticateWithFacebookCommand = new DelegateCommand(() => { ApiAuthentication.AuthenticateWithFacebook(); });
        }
 public GamesController(IApiAuthentication authentication, IGameService gameService, IGenreService genreService, IPublisherService publisherService,
                        IPlatformTypeService platformTypeService, IMapper mapper) : base(authentication)
 {
     _gameService         = gameService;
     _genreService        = genreService;
     _publisherService    = publisherService;
     _platformTypeService = platformTypeService;
     _mapper = mapper;
 }
Beispiel #3
0
        public MainPageViewModel(INavigationService navigationService, IPermissionService permissionService,
                                 IStringLocalizer <MainPageViewModel> localizer, IApiAuthentication apiAuthentication, IAppDataService appDataService,
                                 IMapper mapper)
            : base(navigationService, permissionService, localizer)
        {
            ApiAuthentication = apiAuthentication;
            AppDataService    = appDataService;
            Mapper            = mapper;

            Title       = Localizer[nameof(Title)];
            Instruction = Localizer[nameof(Instruction)];
        }
Beispiel #4
0
        public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
        {
            // Convert NSUrl to Uri
            Uri uri = new Uri(url.AbsoluteString);

            // Load redirectUrl page
            IApiAuthentication apiAuthentication =
                ((PrismApplicationBase)Xamarin.Forms.Application.Current).Container.Resolve <IApiAuthentication>();

            apiAuthentication.Authenticator.OnPageLoading(uri);

            return(true);
        }
Beispiel #5
0
 public DefaultController(
     IApiSearch apiSearch, IApiRules apiRules, IApiSetup apiSetup, IApiAuthentication apiAuthentication,
     IApiAthlete apiAthlete, IApiReports apiReports, IApiStartingList apiStartingList, IApiExport apiExport)
 {
     this.apiSearch         = apiSearch;
     this.apiRules          = apiRules;
     this.apiSetup          = apiSetup;
     this.apiAuthentication = apiAuthentication;
     this.apiAthlete        = apiAthlete;
     this.apiReports        = apiReports;
     this.apiStartingList   = apiStartingList;
     this.apiExport         = apiExport;
 }
Beispiel #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Convert Android.Net.Url to Uri
            Uri uri = new Uri(Intent.Data.ToString());

            // Load redirectUrl page
            IApiAuthentication apiAuthentication =
                ((PrismApplicationBase)Xamarin.Forms.Application.Current).Container.Resolve <IApiAuthentication>();

            apiAuthentication.Authenticator.OnPageLoading(uri);

            Intent intent = new Intent(this, typeof(MainActivity));

            intent.SetFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop);
            StartActivity(intent);

            Finish();
        }
Beispiel #7
0
        protected override bool IsAuthorized(HttpActionContext actionContext)
        {
            _authentication = DependencyResolver.Current.GetService <IApiAuthentication>();
            IEnumerable <string> tokens;

            actionContext.Request.Headers.TryGetValues(TokenName, out tokens);
            var token = tokens?.First();

            if (token == null)
            {
                return(false);
            }

            var user = _authentication.GetUserByToken(token);

            if (_mode == AuthorizationMode.Allow)
            {
                return(user != null && _roles.Any(x => user.IsInRole(x.ToString())));
            }

            return(user != null && !_roles.Any(x => user.IsInRole(x.ToString())));
        }
Beispiel #8
0
 public CommentsController(IApiAuthentication authentication, ICommentService commentService, IMapper mapper) : base(authentication)
 {
     _commentService = commentService;
     _mapper         = mapper;
 }
 public GenresController(IApiAuthentication authentication, IGenreService genreService, IMapper mapper) : base(authentication)
 {
     _genreService = genreService;
     _mapper       = mapper;
 }
Beispiel #10
0
 public BaseController(IApiAuthentication authentication)
 {
     _authentication = authentication;
 }
 public PublishersController(IApiAuthentication authentication, IPublisherService publisherService, IMapper mapper) : base(authentication)
 {
     _publisherService = publisherService;
     _mapper           = mapper;
 }
Beispiel #12
0
 public UserFunctions(UserRepositoryFactory userRepoFactory, IApiAuthentication apiAuthentication)
 {
     _repoFactory       = userRepoFactory;
     _apiAuthentication = apiAuthentication;
 }
Beispiel #13
0
 public HazardInfoApi(IApiAuthentication apiAuthentication) : base(apiAuthentication)
 {
 }
 protected BaseFunction(IApiAuthentication apiAuthentication)
 {
     ApiAuthentication = apiAuthentication;
 }
 public BaseKitsApi(IApiAuthentication apiAuthentication)
 {
     _apiAuthentication = apiAuthentication;
 }
Beispiel #16
0
 protected HazardApiBase(IApiAuthentication apiAuthentication)
 {
     _apiAuthentication = apiAuthentication;
 }
 public EmergencyKitsApi(IApiAuthentication apiAuthentication)
 {
     _apiAuthentication = apiAuthentication;
 }
 public PhotoFunction(IApiAuthentication apiAuthentication) :
     base(apiAuthentication)
 {
 }
Beispiel #19
0
 public ApplicationFunctions(ApplicationRepositoryFactory appRepoFactory, IApiAuthentication apiAuthentication)
 {
     //_repoFactory = userRepoFactory;
     _appRepoFactory    = appRepoFactory;
     _apiAuthentication = apiAuthentication;
 }
 public FamilyPlansApi(IApiAuthentication apiAuthentication)
     : base(apiAuthentication)
 {
 }
Beispiel #21
0
 public ApiClient(IApiAuthentication apiAuthentication)
 {
     ApiAuthentication = apiAuthentication;
 }
Beispiel #22
0
 public AppDataService(IApiAuthentication apiAuthentication, IAppDataContext context)
 {
     ApiAuthentication = apiAuthentication;
     Context           = context;
 }
Beispiel #23
0
 public FamilyPlansApi(IApiAuthentication apiAuthentication)
 {
     _apiAuthentication = apiAuthentication;
 }
Beispiel #24
0
 public Account(IApiAuthentication auth)
 {
     _auth = auth;
 }
Beispiel #25
0
 public OrdersController(IApiAuthentication authentication, IOrderService orderService, IMapper mapper) : base(authentication)
 {
     _orderService = orderService;
     _mapper       = mapper;
 }
Beispiel #26
0
 public OrganizationFunctions(IOrganizationRepository repo, UserRepositoryFactory repoFactory, IApiAuthentication apiAuthentication)
 {
     _repo              = repo;
     _userRepoFactory   = repoFactory;
     _apiAuthentication = apiAuthentication;
 }
Beispiel #27
0
 public HazardHuntsApi(IApiAuthentication apiAuthentication) : base(apiAuthentication)
 {
 }