Skip to content

HexaEight Middlewares uses HexaEight Token Server to provide protection for your API by implementing token-less authentication provided by HexaEight Sessions

License

Notifications You must be signed in to change notification settings

HexaEightTeam/HexaEight-Middleware

Repository files navigation

HexaEight-Session-Middleware

HexaEight Middleware uses token-less authentication and protects your Backend APIs without relying on HTTPs by using Client Tokens provided by HexaEight Token Server to decrypt incoming requests and encrypt outgoing responses from and to HexaEight Front End Sessions.

HexaEight Middleware is currently available as

HexaEight Middleware intercepts every request and examines if the request is authenticated, if the request is an authenticated request, it populates the Http Context with an identity claim like shown below with all the information required for the Server Application.

Sender : Contains the email address of the sender
Receiver : Contains your own resource name for verification purposees
ID : Unique ID per Client Application
RequestTime : Unix Timestamp when the request was sent
RequestRcvd : Unix Timestamp when the request was received (This is automatically computed by the Middleware)
MessageVerifier : The message verifier that is used for validating PKCE requests
RequestHash : A unique hash of the request, can be used to deteect replay transactions, like for example a Card purchase txn.
OriginHash : This contains the hash of the Client Application which sent the request, (Note : This cannot be spoofed)
Scope : The Scope/Role which was used to login to the Client Application
PkceVerified : If true, then this entire message has been verified and it can safely be consumed by the pipeline
Provider : HexaEight - This is a constant which can be used to verify if the incoming request is an HexaEight Session.

Note: The developer/implementor of HexaEight Middleware must remember that the request from HexaEight Session inside the Client Application will reach the Middleware API Server only if HexaEight Token Server authorizes the request and issues a Valid Client Token for the Middleware API Server. Hence there is no specific authorization logic implemented inside the Middleware code. It is up to the developer/implementor to add additional authorization if required for the application as per their requirements

HexaEight-Application-Life-Cycle

Below is a sample request url captured by the Middleware session. Note that the entire URL is encrypted by HexaEight Client Session before it is inspected by HexaEight Middleware for consumption.

info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://localhost:5000/DY8YEf6N6oV6EylRf07!2BEroXnmTCQuYHnleCb2KN!2FiSqRvU7yUmJDD4zvwECeH1wU0p7Q9Utt3A3UKOB!2BypfFU!2BoPQU6B4R9!2FYJwPJdtJnsqPIF5UmTOLjMBUEmaF1RI7lZxL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EHYAQd00g1tgWk7cGD4ESMH3ngcF8yDe0b1Hojjly0!3D - - - 200 - application/octet-stream 3984.0168ms

Demo/Integrations

Below are the Server side Demo code samples which can be used to protect APIs

Sample-Weather-Application (.NET Core) - Written in c#

Sample Proxy Server using YARP - Coming Soon

About

HexaEight Middlewares uses HexaEight Token Server to provide protection for your API by implementing token-less authentication provided by HexaEight Sessions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages