Skip to content
tide-foundationPublic

About

Vendor server-side libraries to validate and test Tide Security

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Asgard

TideCloak's Cyber-Herd Immunity Server SDK
Authentication, authorization and authority for server apps - completely removing the need for blind trust in your application.

.NET 10 Built for TideCloak

Getting started Β· Usage Β· Examples

With Asgard, your application can verify TideCloak logins, encrypt and decrypt data without ever holding the key (ineffable locking), and securely exchange tokens between services.

Important

For compatibility, Asgard requires the web client side to use the tidecloak-js library, which handles the browser authentication, delegation and approval flows.

Features

🌐 Tide Network connectivity

Interact with the Tide Network directly from your ASP.NET application.

πŸ”’ Locking data

Lock down sensitive application data with a key you don't hold, only accessible through your application policies.

πŸ”“ Unlocking data

Like locking the data, except your policies determine who or what has the authority to do so.

πŸ“œ Policy creation

Create programmable policies to protect your users and data with a smart-contract-like logic.

πŸ” Browser-delegated token exchange

A user's DPoP-bound token delegates to your service, so it can act on their behalf. Only available with TideCloak.

πŸ”— Service-delegated token exchange

A service's mTLS-bound token delegates to services downstream, so they can act on its behalf. Only available with TideCloak.

Supported Frameworks

Package Framework Language
Link ASP.NET C#
Planned Python Python
Planned NextJS Typescript

How does this all work?

Asgard mTLS certificate auto-registration

sequenceDiagram
    box rgba(59, 130, 246, 0.15) Your application
        participant Browser@{ "type": "boundary", "alias": "Browser Client<br/>(using tidecloak-js)" }
        participant Backend@{ "type": "control", "alias": "ASP.NET Backend<br/>(using Asgard)" }
    end
    box rgba(139, 92, 246, 0.15)
        participant TideCloak@{ "type": "entity", "alias": "TideCloak IAM" }
    end
    box rgba(16, 185, 129, 0.15)
        participant TideNetwork@{ "type": "collections", "alias": "Tide Network" }
    end
    actor Admins

    Admins->>TideCloak: Download backend adapter config<br/>(includes one-time enrollment token)
    Admins->>Backend: Install adapter config in ASP.NET configuration

    Note over Backend: Generate resource keys (identity + Tide)<br/>and certificate request
    Backend->>TideCloak: Request resource identity certificate<br/>(using one-time enrollment token)

    loop Until approved
        Backend->>TideCloak: Has resource identity been approved?
        TideCloak-->>Backend: Not approved
    end

    Admins->>TideCloak: Approve certificate request
    TideCloak->>TideNetwork: Sign resource identity certificate
    TideNetwork-->>TideCloak: Signed certificate

    Backend->>TideCloak: Has resource identity been approved?
    TideCloak-->>Backend: Yes - signed resource identity certificate<br/>+ tidecloak realm certificate
    Backend->>Backend: Verify both certificates,<br/>verify realm certificate key = Tide vendor key,<br/>use resource identity certificate
Loading

Asgard Resource Delegation

sequenceDiagram
    box rgba(59, 130, 246, 0.15) Your application
        participant Browser@{ "type": "boundary", "alias": "Browser Client<br/>(using tidecloak-js)" }
        participant Backend@{ "type": "control", "alias": "ASP.NET Backend<br/>(using Asgard)" }
    end
    box rgba(246, 236, 92, 0.15)
        participant OtherResource@{ "type": "entity", "alias": "Files Resource" }
    end
    box rgba(139, 92, 246, 0.15)
        participant TideCloak@{ "type": "entity", "alias": "TideCloak IAM" }
    end
    box rgba(16, 185, 129, 0.15)
        participant TideNetwork@{ "type": "collections", "alias": "Tide Network" }
    end

    Browser->>Backend: Perform analysis on user files
    Note over Backend: Requires resource delegation<br/>approval from user
    Backend-->>Browser: Get delegation approval of my resource key
    Browser->>Browser: Sign approval with<br/>browser stored DPoP key

    opt Tide-secured delegation
        Browser->>Browser: Also sign approval with<br/>user's Tide session key
    end

    Browser->>Backend: Resource delegation approval
    Backend->>Backend: Verify approval
    Backend->>TideCloak: Exchange user token using delegation approval<br/>(over mTLS, using resource identity certificate)
    TideCloak->>TideNetwork: Sign exchanged token, verify approval
    TideNetwork-->>TideCloak: Signed token
    TideCloak-->>Backend: Exchanged token tied to resource mTLS<br/>+ doken for Tide Network requests (Tide-secured delegation only)
    Backend->>OtherResource: Request user files, authorized with<br/>resource mTLS bound token
Loading

Encryption

sequenceDiagram
    actor User
    box rgba(59, 130, 246, 0.15) Your application
        participant Browser@{ "type": "boundary", "alias": "Browser Client<br/>(using tidecloak-js)" }
        participant Backend@{ "type": "control", "alias": "ASP.NET Backend<br/>(using Asgard)" }
    end
    box rgba(139, 92, 246, 0.15)
        participant TideCloak@{ "type": "entity", "alias": "TideCloak IAM" }
    end
    box rgba(16, 185, 129, 0.15)
        participant TideNetwork@{ "type": "collections", "alias": "Tide Network" }
    end

    User->>Browser: Login
    Browser->>TideCloak: Redirect
    TideCloak->>TideNetwork: Sign user token
    TideNetwork-->>TideCloak: Signed token
    TideCloak-->>Browser: User token tied to browser stored DPoP key

    Browser->>Backend: Encrypt my details
    Note over Browser,TideNetwork: Backend gets an mTLS bound token + doken through Tide-secured delegation<br/>(see Asgard Resource Delegation above)
    Backend->>TideCloak: Get encryption policy,<br/>authorized with mTLS bound token
    TideCloak-->>Backend: Policy
    Backend->>TideNetwork: Encrypt user details under policy, authorized with doken
    TideNetwork-->>Backend: Encrypted details
Loading

Decryption

sequenceDiagram
    actor User
    box rgba(59, 130, 246, 0.15) Your application
        participant Browser@{ "type": "boundary", "alias": "Browser Client<br/>(using tidecloak-js)" }
        participant Backend@{ "type": "control", "alias": "ASP.NET Backend<br/>(using Asgard)" }
    end
    box rgba(139, 92, 246, 0.15)
        participant TideCloak@{ "type": "entity", "alias": "TideCloak IAM" }
    end
    box rgba(16, 185, 129, 0.15)
        participant TideNetwork@{ "type": "collections", "alias": "Tide Network" }
    end

    User->>Browser: Login
    Browser->>TideCloak: Redirect
    TideCloak->>TideNetwork: Sign user token
    TideNetwork-->>TideCloak: Signed token
    TideCloak-->>Browser: User token tied to browser stored DPoP key

    Browser->>Backend: Show my details
    Note over Browser,TideNetwork: Backend gets an mTLS bound token + doken through Tide-secured delegation<br/>(see Asgard Resource Delegation above)
    Backend->>TideCloak: Get decryption policy,<br/>authorized with mTLS bound token
    TideCloak-->>Backend: Policy
    Backend->>TideNetwork: Decrypt user details under policy, authorized with doken
    TideNetwork->>TideNetwork: Policy checks the caller<br/>and the details' tags
    TideNetwork-->>Backend: Each node's partial decryption
    Backend->>Backend: Combine partial decryptions,<br/>decrypt details
    Backend-->>Browser: User details
Loading

5 concepts to know

New to TideCloak? These are the only terms you need for these guides:

  • Realm β€” your app's own space in TideCloak: its users, clients and policies.
  • Client β€” a registration in the realm for each app that talks to TideCloak. A public client (e.g. your login page) runs in the browser and can't keep a secret; a confidential client (your backend) can prove its own identity β€” with Asgard, using a certificate signed by the Tide network.
  • Caller β€” the logged-in user behind the current request. Their token arrives in the Authorization header of every call to your API.
  • Programmable policy β€” a rule stored in TideCloak and enforced by the Tide network that defines who may lock or unlock what.
  • Ineffable locking β€” encryption performed by the Tide network where the key never exists anywhere in full β€” no key material should be stored by your app.

For a deeper dive into policies and contracts, see the Forseti engine docs.

Repository layout

The .NET solution lives at aspnet/Tide.Asgard.AspNetCore/Tide.Asgard.sln and contains:

Project Purpose
Tide.Asgard.AspNetCore.Authentication Main SDK β€” AddAsgard, DPoP- and mTLS-bound token validation, resource delegation, locking and unlocking, policies, token exchange
Tide.Asgard.Core Cryptography primitives (Ed25519 / EdDSA), policy helpers
Tide.Asgard.AspNetCore.Example End-to-end sample

The example apps each have their own projects and README:

Example Shows
StandardResourceDelegation A backend fetching TideCloak's user list on behalf of the logged-in user
LockingUserDataWithTide Adding a policy at first use, and locking user data with the Tide network
ResourceToResourceDelegation A web app storing locked patient data, and an analytics service it calls for the user over mTLS, which unlocks and analyses that data β€” dockerized

License

This project is dual-licensed:

  • ASP.NET Core authentication libraries (aspnet/Tide.Asgard.AspNetCore/Tide.Asgard.AspNetCore/): Derived from the Auth0 ASP.NET Core Authentication API, which is licensed under the Apache License 2.0. Modifications by Tide Foundation Limited are subject to both the Apache 2.0 license (for the derived portions) and the Tide Community Open Code License (for new additions). See the NOTICE file for full attribution details.
  • Core cryptography libraries (aspnet/Tide.Asgard.AspNetCore/Tide.Asgard.Core/): Derived from ScottBrady.IdentityModel, which is licensed under the Apache License 2.0. Modifications by Tide Foundation Limited are subject to both the Apache 2.0 license (for the derived portions) and the Tide Community Open Code License (for new additions). See the NOTICE file for full attribution details.

About

Vendor server-side libraries to validate and test Tide Security

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages