Author: Daniel

  • Micro1: What & Why Should You Care?

    Micro1: What & Why Should You Care?

    In recent times, the term Micro1 is gaining traction in Reddit. I am writing this post to understand what Micro1 is and why should one care?

    Micro1, founded by Ali Ansari, is an AI powered talent and recruiting platform. Micro1 also helps AI companies to train their models by providing training data.

    Zara is the core product at Micro1 that vets candidates and conducts early-stage interviews at scale.

    At Micro1, Talent marketplace exists and connects vetted engineers, domain experts and professionals with companies.

    Why Should You Care?

    Micro1 has raised $35 million in Series A funding and the company’s gross annual run rate is $500 million.

    There are three major reasons why professionals are paying attention to Micro1.

    1. Micro1 provides the human expertise to evaluate complex model outputs at scale.
    2. The business model scales because Micro1 recruits specialists as contractors rather than permanent employees.
    3. Micro1 is constantly expanding services beyond recruitment.

    All these are strong indicators for skilled professionals to be part of Micro1.

  • JWT For Dummies

    What is JWT?

    JWT stands for Json Web Token. It is a compact, signed token (string) that represents user’s authenticated identity.

    What Problem Does JWT Solve?

    You won’t need JWT unless you need a way to solve authentication and authorization for your front-end applications. Storing user’s identity in the browser is prone to risk. Reloading every page in your application to validate user’s identity is bad UX.

    Therefore, we need a mechanism to infer user’s identity without exposing the password along with user’s capabilities (authorization) and JWT solves exactly that.

    JWT Structure

    JSON has three parts — header, payload & signature.

    HEADER.PAYLOAD.SIGNATURE

    Header describes the type and the signing algorithm that is used.

    {
      "alg": "HS256",
      "typ": "JWT"
    }

    Payload contains the information associated with the token. The standard claims in the payload are: Subject (sub), Issued At (iat), Expiration time (exp), Issuer (iss), Intended audience (aud) & Unique token ID (jti)

    {
      "sub": "user_123",
      "role": "doctor",
      "iat": 1791268200,
      "exp": 1791269100
    }

    In addition to the standard claims, application specific claims can also be included.

    {
      "sub": "user_123",
      "role": "doctor",
      "permissions": [
        "patient:read",
        "patient:update"
      ]
    }

    Signature (Secret_Key) is what prevents someone from changing the token.

    HMAC-SHA256(
        base64Url(header) + "." + base64Url(payload),
        SECRET_KEY
    )

    Here is an useful mental model:

    JWT
    ├── Header
    │   ├── alg       ← standard JOSE header parameter
    │   └── typ       ← standard JOSE header parameter
    │
    ├── Payload
    │   ├── iss       ← standard JWT claim
    │   ├── sub       ← standard JWT claim
    │   ├── aud       ← standard JWT claim
    │   ├── exp       ← standard JWT claim
    │   ├── iat       ← standard JWT claim
    │   │
    │   ├── role      ← your custom claim
    │   └── permissions ← your custom claim
    │
    └── Signature

    How JWT Works?

    Consider a Node JS application where the server returns a JWT (usually with an expiry of 5-15 mins) to the front-end once user successfully authenticates. When the server returns the JWT, it also sets the refresh token as a HTTP only cookie (Javascript cannot read this value) alongside.

    An example JWT token looks like the following:

    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIsInJvbGUiOiJkb2N0b3IifQ.abc123signature

    When front-end application makes a request, the refresh token is usually sent along by the browser. The browser decides the cookies to be sent based on domain/path.

    On each request, the server receives both the access token ad the refresh token. The server can then check the expiry of the access token and use the refresh token to validate and return a new access token. This is how JWT usually works.

    I’m sure you’ve questions regarding JWT. I would be happy to answer them in the comments.

  • Hello world!

    Hi! I’m Daniel and I intend to write about business, software engineering and some personal happenings in my life.

    I find joy documenting my life and in writing. This blog will carry my experiences so one day my kid may find the “why” behind my doings.

    This blog also helps me to reflect on my life. As a reader, I’m sure you will have something to take away from my experiences. In case you do not have a blog, I strongly encourage you to blog. Happy blogging!