https://github.com/acdh-oeaw/learn-auth-via-jwt

https://github.com/acdh-oeaw/learn-auth-via-jwt

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: acdh-oeaw
  • License: mit
  • Language: Vue
  • Default Branch: master
  • Size: 882 KB
Statistics
  • Stars: 0
  • Watchers: 6
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

readme.md

learn auth via jwt

JWT/JWS Structure

a jwt consists of 3 parts: header, payload, and signature.

Header

The header is a JSON element that describes the type of token and the signature method used.

| Field | Name | Meaning |
|--------|--------------|----------|
| typ | Type | Describes the IANA media type of the token. This value is always JWT to indicate the media type application/jwt. |
| cty | Content Type | This field is needed if the JWT contains another JWT as its payload. In this case, it is set to JWT. Otherwise, this field should be omitted. |
| alg | Algorithm | Describes the signature method used. Typically, HMAC with SHA-256 (HS256) or RSA with SHA-256 (RS256) is used. It is possible to use no signature (none), but this is not recommended. The possible values are standardized by JSON Web Encryption (JWE) according to RFC 7516. |

An example of a header looks as follows:

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

Payload

The payload is a JSON element that describes the claims.

json { "sub": "1234567890", "name": "John Doe", "admin": true }

reserved claims as per IANA.

| Field | Name | Meaning |
|--------|---------------|----------|
| iss | Issuer | The issuer of the token. |
| sub | Subject | Defines the subject for which the claims apply. The sub field specifies for whom or what the claims are made. |
| aud | Audience | The target domain for which the token was issued. |
| exp | Expiration Time | The expiration time of the token in Unix time, i.e., the number of seconds since 1970-01-01T00:00:00Z. |
| nbf | Not Before | The Unix time from which the token is valid. |
| iat | Issued At | The Unix time when the token was issued. |
| jti | JWT ID | A unique case-sensitive string that uniquely identifies the token. This helps prevent token replication. It can be a sequential number, a GUID, or a hash value. If the token recipient receives tokens from multiple issuers, the JWT ID might not be unique. By combining the issuer (iss) and JWT ID (jti), uniqueness can be ensured. (RFC 7519) |

Signature

defined as per RFC 7515.

created by hashing and encrypting the Base64-encoded header and payload, separated by a dot (.), using the specified hash method (e.g., SHA-256) and encryption (e.g., HMAC):

javascript var encodedString = base64UrlEncode(header) + "." + base64UrlEncode(payload); var signature = HMACSHA256(encodedString, secret);

how to run

prerequisites:

[!TIP]

you can use pnpm to install the required node.js version with pnpm env use 22 --global

set required environment variables in .env.local:

bash cp .env.local.example .env.local

Owner

  • Name: Austrian Centre for Digital Humanities & Cultural Heritage
  • Login: acdh-oeaw
  • Kind: organization
  • Email: acdh@oeaw.ac.at
  • Location: Vienna, Austria

GitHub Events

Total
  • Push event: 1
  • Create event: 1
Last Year
  • Push event: 1
  • Create event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 2
  • Total Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
ctot-nondef c****n@o****t 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

package.json npm
  • @acdh-oeaw/eslint-config ^2.0.9 development
  • @acdh-oeaw/eslint-config-nuxt ^2.0.14 development
  • @acdh-oeaw/eslint-config-playwright ^2.0.10 development
  • @acdh-oeaw/eslint-config-tailwindcss ^2.0.11 development
  • @acdh-oeaw/eslint-config-vue ^2.0.12 development
  • @acdh-oeaw/prettier-config ^2.0.1 development
  • @acdh-oeaw/stylelint-config ^2.1.2 development
  • @acdh-oeaw/tailwindcss-preset ^0.0.22 development
  • @acdh-oeaw/tsconfig ^1.5.1 development
  • @nuxt/devtools ^2.3.1 development
  • @nuxt/eslint ^1.2.0 development
  • @nuxtjs/tailwindcss ^6.13.2 development
  • @playwright/test ^1.51.1 development
  • @tailwindcss/typography ^0.5.16 development
  • @types/node ^22.13.10 development
  • axe-core ^4.10.3 development
  • axe-playwright ^2.1.0 development
  • ci-info ^4.2.0 development
  • dotenv ^16.4.7 development
  • dotenv-cli ^7.4.4 development
  • dotenv-expand ^11.0.7 development
  • eslint ^9.22.0 development
  • eslint-config-flat-gitignore ^0.3.0 development
  • globals ^16.0.0 development
  • is-ci ^3.0.1 development
  • lint-staged ^15.5.0 development
  • npm-run-all2 ^7.0.2 development
  • postcss ^8.5.3 development
  • prettier ^3.5.3 development
  • schema-dts ^1.1.5 development
  • simple-git-hooks ^2.11.1 development
  • stylelint ^16.16.0 development
  • tailwindcss ^3.4.17 development
  • typescript ^5.8.2 development
  • vite ^6.2.2 development
  • vue-tsc ^2.2.8 development
  • @acdh-oeaw/lib ^0.1.12
  • @acdh-oeaw/style-variants ^0.1.0
  • @fontsource-variable/inter ^5.2.5
  • @nuxt/image ^1.10.0
  • @nuxtjs/color-mode ^3.5.2
  • @nuxtjs/i18n ^9.3.2
  • @pinia/nuxt ^0.10.1
  • @radix-icons/vue ^1.0.0
  • @tanstack/vue-table ^8.21.2
  • @unovis/ts ^1.5.1
  • @unovis/vue ^1.5.1
  • @vee-validate/zod ^4.15.0
  • @vueuse/core ^11.3.0
  • @vueuse/nuxt ^11.3.0
  • bcryptjs ^3.0.2
  • class-variance-authority ^0.7.1
  • clsx ^2.1.1
  • embla-carousel-vue ^8.5.2
  • fast-glob ^3.3.3
  • jose ^6.0.10
  • lucide-vue-next ^0.453.0
  • nuxt ^3.16.1
  • openapi-fetch ^0.13.5
  • pinia ^3.0.1
  • pinia-plugin-persistedstate ^4.2.0
  • pino-http ^10.4.0
  • radix-vue ^1.9.17
  • reka-ui ^2.1.0
  • satori ^0.11.3
  • shadcn-nuxt 0.11.3
  • tailwind-merge ^2.6.0
  • tailwindcss-animate ^1.0.7
  • valibot ^0.42.1
  • vaul-vue ^0.2.1
  • vee-validate ^4.15.0
  • vue ^3.5.13
  • vue-i18n ^10.0.6
  • vue-i18n-routing ^1.2.0
  • vue-router ^4.5.0
  • vue-sonner ^1.3.0
  • zod ^3.24.2
pnpm-lock.yaml npm
  • 390 dependencies