Courses / Professional engineering / API Authentication & OAuth 2.0

₹996 languagesSelf-paced

API Authentication & OAuth 2.0

Implement sessions, token verification, OAuth 2.0 authorization code with PKCE and OIDC sign-in on a local lab stack, and enforce permissions in an API.

  • Who it's for. Developers who build HTTP APIs and know basic secure-coding habits.
  • Before you start. Courses: REST API Design, Secure Coding Fundamentals.
  • 32 to 54 hours of study with practice
  • 8 modules, 54 lessons
  • 4 guided projects and a final project

What you'll learn

  • Separate identification, authentication and authorization and place each check correctly in a request path.
  • Store credentials and manage sessions defensively (salted slow hashes, opaque ids, cookie attributes, rotation, CSRF protection).
  • Issue and verify signed tokens with pinned algorithms, claim validation and key rotation per RFC 8725.
  • Choose the right OAuth grant and implement authorization code with PKCE, state and exact redirect matching against a local lab IdP.
  • Add OpenID Connect sign-in with ID-token validation, nonce, UserInfo and (iss, sub) account keys.

Skills you'll gain

  • Identity
  • sessions
  • Tokens
  • claims
  • OAuth actors
  • flows
  • Authorization-code
  • PKCE
  • OIDC boundaries
  • Token storage
  • expiry
  • Permissions
  • revocation

Tools you'll use

  • Python
  • Local lab identity provider

Details to know

  • Certificate on completionIssued after your final project is reviewed
  • 8 module checkpointsA quiz and a practical task close each module
  • Self-pacedStudy any time; your progress is saved

How every lesson works

Each lesson follows the same four steps, so you always know what comes next.

  1. 01

    Watch & Learn

    A short animated video explains one idea at a time.

  2. 02

    Guided Practice

    Work through an example step by step and check the result.

  3. 03

    Quiz & Challenge

    Short questions check the idea has landed before you move on.

  4. 04

    Mini Project

    Build something useful from a project brief.

Learn at your own pace

This is a self-paced course. There are no live classes and no fixed timetable.

  • Start any timeStudy when it suits you. Lessons are short, so they fit around work or college.
  • Pick up where you left offYour progress is saved to your account.
  • Ask when you're stuckUse Ask Mentor inside the learning platform.

Your path in 5 phases

Each phase ends with something you have built and checked.

  1. 01

    Module 1

    Hardened credential and session service

    Covers Identity and sessions.

    You build: Guided project: Trace table, salted-KDF credential store, opaque session store and justified cookie headers.

  2. 02

    Module 2

    Token verifier with rejection matrix

    Covers Tokens and claims.

    You build: Guided project: Decoder, HMAC signer/verifier and claim validation with injected clock.

  3. 03

    Modules 3 to 5

    Authorization-code client with PKCE and OIDC sign-in

    Covers OAuth actors and flows, Authorization-code and PKCE and OIDC boundaries.

    You build: Guided project: Role and flow design pack, client registration table, client-credentials caller, state and S256 helper.

  4. 04

    Modules 6 to 7

    Token lifecycle and resource-server enforcement

    Covers Token storage and expiry and Permissions and revocation.

    You build: Guided project: Storage table, lifetime numbers, renewal manager, rotation with reuse detection, leak-free transport and key rotation.

  5. 05

    Module 8

    Final project and assessment

    Covers Authentication integration lab, then the final project: Local authentication flow with threat model and verified authorization.

    You build: Final project, one of: Option A: Booking platform. Local IdP, web client (server-side session holding tokens) and booking API with scopes and ownership rules.

Full curriculum

8 modules and 54 lessons, 32 to 54 hours of study

01Identity and sessions7 lessons, 3 to 5 hours

Lessons

  • Three questions: identify, authenticate, authorize
  • Verifying passwords with a salted slow hash
  • Server-side sessions and opaque session ids
  • Cookie attributes that constrain a session
  • Session lifecycle: fixation, rotation and timeouts
  • CSRF against cookie-authenticated APIs
  • API keys and Basic credentials for machine callers

After this module you can

  • Classify each step of a request trace as identification, authentication or authorization and name which failure status each produces.
  • Store and verify a password using a per-user salt and a deliberately slow key-derivation function, comparing in constant time.
  • Issue, store and verify API keys safely as hashed secrets with an identifying prefix and scopes.
02Tokens and claims7 lessons, 3 to 5 hours

Lessons

  • Opaque reference tokens versus self-contained tokens
  • Anatomy of a JSON Web Token
  • Signing and verifying with HMAC
  • Validating registered claims: exp, nbf, iss, aud
  • Algorithm pinning and the none-algorithm trap
  • Public-key verification, JWKS and kid selection
  • Token typing and cross-token confusion

After this module you can

  • Choose between an opaque token looked up at the issuer and a self-contained signed token for a given service, naming the revocation and latency trade-off.
  • Decode a three-part compact JWT by hand, identify header, payload and signature, and explain why decoding is not verification.
  • Prevent an ID token, access token or other signed JWT from being accepted in the wrong role using explicit typing and distinct validation rules.
03OAuth actors and flows7 lessons, 3 to 5 hours

Lessons

  • Resource owner, client, authorization server, resource server
  • Endpoints and message anatomy
  • Public and confidential clients, registration and redirect URIs
  • Scopes, consent and least privilege
  • Choosing a grant type for the situation
  • Client credentials flow for service-to-service calls
  • OAuth 2.0, OAuth 2.1 draft and the RFC lineage

After this module you can

  • Map any delegated-access scenario onto the four RFC 6749 roles and identify what each role must never see or hold.
  • Identify what travels on the authorization endpoint versus the token endpoint and which channel (front or back) each uses.
  • State accurately what RFC 6749, RFC 9700 and the OAuth 2.1 Internet-Draft each are and what changes between them.
04Authorization-code and PKCE7 lessons, 3 to 5 hours

Lessons

  • Authorization-code flow end to end
  • The state parameter and login CSRF
  • PKCE: code_verifier and code_challenge
  • Token endpoint exchange and verifier checking
  • Exact redirect URI matching and open redirectors
  • Downgrade protection: why PKCE needs server-side enforcement
  • Loopback redirects for native tools and issuer confusion

After this module you can

  • Walk the authorization-code flow step by step and name the party, channel and artefact at each of its steps.
  • Generate, store and verify state so a callback that the client did not initiate is rejected.
  • Configure a desktop tool to receive the callback on a loopback port and explain the mix-up defence using the iss parameter.
05OIDC boundaries6 lessons, 3 to 4 hours

Lessons

  • What OpenID Connect adds to OAuth 2.0
  • Reading and validating an ID token
  • Nonce: binding the ID token to the login request
  • UserInfo endpoint, scopes and claims
  • Identity keys: iss plus sub, not email
  • Issuer, discovery metadata and trust configuration

After this module you can

  • State what OIDC adds on top of OAuth and why OAuth alone does not tell a client who the user is.
  • Validate an ID token following Core 1.0 section 3.1.3.7: issuer, audience, signature, expiry, nonce.
  • Configure a client from provider metadata and fail closed when the issuer in the metadata or token does not match configuration.
06Token storage and expiry7 lessons, 3 to 5 hours

Lessons

  • Where each client type keeps its tokens
  • Access token lifetime and the cost of long tokens
  • Refresh tokens and the renewal grant
  • Refresh token rotation and reuse detection
  • Transporting tokens: headers, URLs and caches
  • Sender-constrained tokens: DPoP and mutual TLS
  • Secrets hygiene for client secrets and signing keys

After this module you can

  • Choose storage for tokens in a server-rendered app, a browser SPA and a native app and state the threat each choice faces.
  • Pick an access token lifetime for a service by relating it to revocation delay and renewal load.
  • Load client secrets and signing keys from configuration, redact them in logs, and rotate them without downtime.
07Permissions and revocation7 lessons, 3 to 5 hours

Lessons

  • Bearer token extraction and the 401 challenge
  • Scope enforcement at the resource server
  • Roles, permissions and policy decisions
  • Object-level authorization: ownership checks
  • Revoking tokens with RFC 7009
  • Token introspection with RFC 7662
  • Revocation strategies for stateless tokens

After this module you can

  • Parse the Authorization header, reject malformed or missing credentials and return a 401 with a WWW-Authenticate challenge.
  • Require specific scopes per endpoint and return 403 with insufficient_scope information.
  • Compare short expiry, denylist, token version and introspection for stateless tokens and choose per risk.
08Authentication integration lab6 lessons, 3 to 4 hours

Lessons

  • Threat modelling the OAuth flow
  • Assembling the local stack
  • A negative-test suite for authentication and authorization
  • Safe authentication logging and audit trails
  • Operational failure drills: clock skew, key rotation, IdP outage
  • Verified authorization demonstration and review

After this module you can

  • Produce a data-flow threat model for the local OAuth system listing assets, trust boundaries, threats and mitigations.
  • Run the lab IdP, a client, and a resource server together on loopback with documented configuration and a one-command start.
  • Present an evidence-backed demonstration that every protected capability is gated and that the threat model's tests pass.

What you'll build

4 guided projects along the way, then a final project.

  • Hardened credential and session service

    after module 1
  • Token verifier with rejection matrix

    after module 2
  • Authorization-code client with PKCE and OIDC sign-in

    after module 5
  • Token lifecycle and resource-server enforcement

    after module 7

What guided project 2 looks like when it runs

You build a token verifier and try thirteen sample tokens against two endpoints. Only the right kind of token, from the right issuer, for the right service and inside its time window gets through.

python matrix.py

token                                       access endpoint                   login endpoint
----------------------------------------------------------------------------------------------------------
T1  valid access token                      accept                            reject: wrong token kind
T2  audience is the sibling service         reject: wrong audience            reject: wrong token kind
T3  issued by another issuer                reject: wrong issuer              reject: wrong token kind
T4  expired 31 seconds ago                  reject: expired                   reject: wrong token kind
T5  expired 29 seconds ago (inside leeway)  accept                            reject: wrong token kind
T6  not valid for another 5 minutes         reject: not valid yet             reject: wrong token kind
T7  one payload character flipped           reject: bad signature             reject: wrong token kind
T8  header says alg none                    reject: algorithm not allowed     reject: algorithm not allowed
T9  header says alg RS256                   reject: algorithm not allowed     reject: algorithm not allowed
T10 signed with key k1, header says k2      reject: bad signature             reject: wrong token kind
T11 kid not in the JWKS                     reject: unknown kid               reject: wrong token kind
T12 scope claim missing                     reject: missing claim scope       reject: wrong token kind
T13 login assertion                         reject: wrong token kind          accept
----------------------------------------------------------------------------------------------------------
26 checks, 3 accepted, 23 rejected. JWKS fetched 3 times.

Final project

Local authentication flow with threat model and verified authorization. Options: Option A: Booking platform. Local IdP, web client (server-side session holding tokens) and booking API with scopes and ownership rules. / Option B: Team notes service.

What you submit

Source and artefact submission: code, configuration, threat model and evidence index in one repository or archive.

How it's reviewed

Trainer-reviewed demonstration. Rubric (proposal): correct flow and parameters (25%) validation and rejection quality including negative tests (25%) token storage, lifetime and revocation reasoning (20%) threat model fidelity to tests (15%).

Where you'll use it

  • Reject expired or wrongly scoped tokens at an API with a tested rejection list.
  • Add sign-in with authorization code and PKCE to a web or command-line client.

Roles that use these skills

  • Backend Developer
  • Identity and Access Engineer
  • Application Security Engineer

Earn the certificate by building, not watching

  1. Complete the lessons and pass each module checkpoint.
  2. Build your final project and demonstrate it.
  3. OUTLEARN reviews your project and issues your certificate. It is not issued automatically.

Frequently asked questions

What do I need before starting?

Comfortable building and calling an HTTP API (REST API Design, the earlier course) and basic secure-coding habits such as trust boundaries and secrets handling (Secure Coding Fundamentals, the earlier course); able to read and write small Python 3 scripts (the lab language; accepted equivalents: any language with an HTTP server library, with the learner translating examples). Diagnostic: write an endpoint that returns 401 for a missing header and 404 for an unknown id.

When do I get a certificate?

We do not issue certificates until you successfully build and demonstrate your live project. Staff issue certificates after review; nothing is issued automatically.

Which languages is this course in?

Every lesson has audio and captions in English, Hindi, Telugu, Tamil, Kannada and Malayalam. You can switch language inside any lesson.

How do I report a problem in a lesson?

Email [email protected] with the course and lesson name. We read every report and correct the lesson.

Start API Authentication & OAuth 2.0 today

Every lesson has audio and captions in English, Hindi, Telugu, Tamil, Kannada and Malayalam.

Start learning
₹99Open now
Start