All Projects → auth0 → Jwtdecode.swift

auth0 / Jwtdecode.swift

Licence: mit
A library to help you decode JWTs in Swift

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Jwtdecode.swift

Koa Vue Notes Api
🤓 This is a simple SPA built using Koa as the backend, Vue as the first frontend, and React as the second frontend. Features MySQL integration, user authentication, CRUD note actions, and async/await.
Stars: ✭ 342 (-10.94%)
Mutual labels:  jwt
Lamp Cloud
lamp-cloud 基于Jdk11 + SpringCloud + SpringBoot的微服务快速开发平台,其中的可配置的SaaS功能尤其闪耀, 具备RBAC功能、网关统一鉴权、Xss防跨站攻击、自动代码生成、多种存储系统、分布式事务、分布式定时任务等多个模块,支持多业务系统并行开发, 支持多服务并行开发,可以作为后端服务的开发脚手架。代码简洁,注释齐全,架构清晰,非常适合学习和企业作为基础框架使用。
Stars: ✭ 4,125 (+974.22%)
Mutual labels:  jwt
Play Pac4j
Security library for Play framework 2 in Java and Scala: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 375 (-2.34%)
Mutual labels:  jwt
Core Nestjs
A simple application demonstrating the basic usage of permissions with NestJS (JWT, Passport, Facebook, Google+, User, Group, Permission)
Stars: ✭ 347 (-9.64%)
Mutual labels:  jwt
React Redux Jwt Authentication Example
React + Redux - JWT Authentication Tutorial & Example
Stars: ✭ 354 (-7.81%)
Mutual labels:  jwt
His
HIS英文全称 hospital information system(医院信息系统http://59.110.234.89:9999/swagger-ui.html ),医疗信息就诊系统,系统主要功能按照数据流量、流向及处理过程分为临床诊疗、药品管理、财务管理、患者管理。诊疗活动由各工作站配合完成,并将临床信息进行整理、处理、汇总、统计、分析等。本系统包括以下工作站:门诊医生工作站、药房医生工作站、医技医生工作站、收费员工作站、对帐员工作站、管理员工作站。需求为东软提供的云医院。
Stars: ✭ 359 (-6.51%)
Mutual labels:  jwt
Jwt Cli
A super fast CLI tool to decode and encode JWTs built in Rust
Stars: ✭ 336 (-12.5%)
Mutual labels:  jwt
Microservices Spring Boot
The source code for series of articles on Medium about Microservices with Spring Boot
Stars: ✭ 382 (-0.52%)
Mutual labels:  jwt
Ember Simple Auth Token
Ember Simple Auth extension that is compatible with token-based authentication like JWT.
Stars: ✭ 356 (-7.29%)
Mutual labels:  jwt
Go Admin
基于Gin + Vue + Element UI的前后端分离权限管理系统脚手架(包含了:多租户的支持,基础用户管理功能,jwt鉴权,代码生成器,RBAC资源控制,表单构建,定时任务等)3分钟构建自己的中后台项目;文档:https://doc.go-admin.dev Demo: https://www.go-admin.dev Antd beta版本:https://preview.go-admin.dev
Stars: ✭ 5,439 (+1316.41%)
Mutual labels:  jwt
Dokit
基于 Spring Boot2、 Jpa、 Spring Security、JWT、redis、Vue的前后端分离的后台管理系统开发平台, 用户管理、菜单管理、角色管理、字典管理、权限控制的方式为RBAC,操作日志、异常日志、接口限流、项目支持数据权限管理,支持一键生成前后端代码(支持在线预览及打包下载),支持前端菜单动态路由 可一键部署服务器应用,数据库。系统中活跃用户状态监控,监视当前系统CPU、内存、磁盘、堆栈等相关信息,基于Element UI在线表单设计及生成Vue代码。
Stars: ✭ 348 (-9.37%)
Mutual labels:  jwt
Vuejs Admin
基于eggjs、vuejs的设备管理系统,有帮助的话麻烦给个star谢谢
Stars: ✭ 350 (-8.85%)
Mutual labels:  jwt
Jwt Cracker
Simple HS256 JWT token brute force cracker
Stars: ✭ 365 (-4.95%)
Mutual labels:  jwt
Serverless Photo Recognition
A collection of 3 lambda functions that are invoked by Amazon S3 or Amazon API Gateway to analyze uploaded images with Amazon Rekognition and save picture labels to ElasticSearch (written in Kotlin)
Stars: ✭ 345 (-10.16%)
Mutual labels:  jwt
Vandium Node
AWS Lambda framework for building functions using Node.js for API Gateway, IoT applications, and other AWS events.
Stars: ✭ 377 (-1.82%)
Mutual labels:  jwt
Springboot Learning
基于Gradle构建,使用SpringBoot在各个场景的应用,包括集成消息中间件、前后端分离、数据库、缓存、分布式锁、分布式事务等
Stars: ✭ 340 (-11.46%)
Mutual labels:  jwt
Lion
使用Gradle构建,基于Java 8/11/13、SpringBoot 2.2.6.RELEASE、SpringCloud Hoxton.SR2、Spring Cloud Alibaba 2.2.0.RELEASE、MyBatis Plus 3.3.1等核心技术体系实现的一套支持云原生的分布式微服务架构,提供OAuth2/JWT权限认证、分布式事务、灰度、限流、熔断降级、分布式锁、链路追踪、MQ等功能,支持Docker容器化部署、镜像交付、K8S容器编排
Stars: ✭ 360 (-6.25%)
Mutual labels:  jwt
Express Rest Api Boilerplate
Express REST API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 384 (+0%)
Mutual labels:  jwt
Jwtproxy
An HTTP-Proxy that adds AuthN through JWTs
Stars: ✭ 379 (-1.3%)
Mutual labels:  jwt
Oauth2orizerecipes
OAuth2 security recipes and examples based on OAuth2orize
Stars: ✭ 367 (-4.43%)
Mutual labels:  jwt

JWTDecode.swift

CircleCI Coverage Status Version License Platform Swift 5.3

This library will help you check JWT payload

This library doesn't validate the token, any well formed JWT can be decoded from Base64Url.

Table of Contents

Requirements

  • iOS 9+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 11.4+ / 12.x
  • Swift 4.x / 5.x

Installation

Cocoapods

If you are using Cocoapods, add this line to your Podfile:

pod 'JWTDecode', '~> 2.6'

Then run pod install.

For more information on Cocoapods, check their official documentation.

Carthage

If you are using Carthage, add the following line to your Cartfile:

github "auth0/JWTDecode.swift" ~> 2.6

Then run carthage bootstrap.

For more information about Carthage usage, check their official documentation.

SPM

If you are using the Swift Package Manager, open the following menu item in Xcode:

File > Swift Packages > Add Package Dependency...

In the Choose Package Repository prompt add this url:

https://github.com/auth0/JWTDecode.swift.git

Then press Next and complete the remaining steps.

For further reference on SPM, check its official documentation.

Usage

Import the framework

import JWTDecode

Decode the token

let jwt = try decode(jwt: token)    

JWT Parts

Header dictionary

jwt.header

Claims in token body

jwt.body

Token signature

jwt.signature

Registered Claims

  • "aud" (Audience)
jwt.audience
  • "sub" (Subject)
jwt.subject
  • "jti" (JWT ID)
jwt.identifier
  • "iss" (Issuer)
jwt.issuer
  • "nbf" (Not Before)
jwt.notBefore
  • "iat" (Issued At)
jwt.issuedAt
  • "exp" (Expiration Time)
jwt.expiresAt

Custom Claims

If we also have our custom claims we can retrive them calling claim(name: String) -> Claim then you can try converting the value like:

let claim = jwt.claim(name: "email")
if let email = claim.string {
    print("Email in jwt was \(email)")
}

The supported conversions are:

var string: String?
var boolean: Bool?
var integer: Int?
var double: Double?
var date: NSDate?
var array: [String]?

You can easily add a convenience accessor for a custom claim by adding an extension:

extension JWT {
    var myClaim: String? {
        return claim(name: "my_claim").string
    }
}

Error Handling

If the token is invalid an NSError will be thrown from the decode(token) function:

catch let error as NSError {
    error.localizedDescription
}

What is Auth0?

Auth0 helps you to:

  • Add authentication with multiple sources, either social identity providers such as Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce (amongst others), or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS, or any SAML Identity Provider.
  • Add authentication through more traditional username/password databases.
  • Add support for linking different user accounts with the same user.
  • Support for generating signed JSON Web Tokens to call your APIs and flow the user identity securely.
  • Analytics of how, when, and where users are logging in.
  • Pull data from other sources and add it to the user profile through JavaScript rules.

Create a Free Auth0 Account

  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub, or Microsoft Account to login.

Issue Reporting

If you have found a bug or to request a feature, please raise an issue. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].