Thanks to visit codestin.com
Credit goes to lib.haxe.org

why-auth


To install, run:

haxelib install why-auth 0.1.1 

See using Haxelib in Haxelib documentation for more information.

README.md

Why Authentication

Abstraction of various authentication mechanism.

Interface

Auth is a server-side interface that identifies an user from some kind of identification. (e.g. access tokens)

interface Auth<User> {
	function authenticate():Promise<Option<User>>;
}

Delegate is a client side interface that allows user to login/logout and generates authentication tokens

interface Delegate<Credentials, Profile> {
	var status(default, null):Observable<Status<Profile>>;
	function getToken():Promise<Option<String>>;
	function signIn(credentials:Credentials):Promise<Profile>;
	function signOut():Promise<Noise>;
}

enum Status<Profile> {
	Initializing;
	SignedOut;
	SignedIn(profile:Profile);
	Errored(e:Error);
}

Implementations

Auth - CognitoAuth authenticates users using AWS Cognito ID token - FirebaseAuth authenticates users using Firebase ID token

Delegate - AmplifyDelegate an implementation for AWS Amplify - DummyDelegate a dummy implementation that exposes the interface methods in a functional programming approach

Plugins

  • AuthSession.hx An implementation for tink_web's Session which allows using why.Auth implementations as authentication providers.
  • DelegateClient.hx An implementation for tink_http's Client which allows using why.Delegate implementations as the provider to generate a AUTHORIZATION HTTP header.
Contributors
kevinresol
Version
0.1.1
Published
7 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub