知识库 知识库
首页
  • Hyperskill - Java

    • Java basic
    • Java OOP
    • 应知
    • 扩展
    • IO & Stream
    • Error & Exception
    • Algorithm & Data structure
    • Design pattern
    • Web
    • Spring boot
  • 练习题

    • 选择题 & 填空题
    • 代码题
  • Frank - Java与生活 (OOP)

    • 参考资料
    • Java基础
    • OOP上半部分
    • OOP下半部分
  • Frank - Java API进阶

    • Base API
    • Unit Test and main function
  • 学习笔记
  • 学习笔记

    • 数据库
  • Frank - MySQL删库跑路

    • 安装、连接、配置
    • 基本操作——数据库
    • 基本操作——表
    • 基本操作——数据
    • 数据类型
    • 列属性完整性
    • 数据库设计思维
    • 单表查询
    • 多表查询
  • 学习笔记

    • 其它
  • Frank - Linux现代方法

    • 必知
    • 命令
    • 技巧
  • 技术文档
  • Git
  • GitHub技巧
  • 前端
  • Khan Academy - 语法
  • Monthly
  • 阅读
  • Others
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
收藏
  • 标签
  • 归档
GitHub (opens new window)

Jim FuckPPT

Java小学生
首页
  • Hyperskill - Java

    • Java basic
    • Java OOP
    • 应知
    • 扩展
    • IO & Stream
    • Error & Exception
    • Algorithm & Data structure
    • Design pattern
    • Web
    • Spring boot
  • 练习题

    • 选择题 & 填空题
    • 代码题
  • Frank - Java与生活 (OOP)

    • 参考资料
    • Java基础
    • OOP上半部分
    • OOP下半部分
  • Frank - Java API进阶

    • Base API
    • Unit Test and main function
  • 学习笔记
  • 学习笔记

    • 数据库
  • Frank - MySQL删库跑路

    • 安装、连接、配置
    • 基本操作——数据库
    • 基本操作——表
    • 基本操作——数据
    • 数据类型
    • 列属性完整性
    • 数据库设计思维
    • 单表查询
    • 多表查询
  • 学习笔记

    • 其它
  • Frank - Linux现代方法

    • 必知
    • 命令
    • 技巧
  • 技术文档
  • Git
  • GitHub技巧
  • 前端
  • Khan Academy - 语法
  • Monthly
  • 阅读
  • Others
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
收藏
  • 标签
  • 归档
GitHub (opens new window)
  • Hyperskill - Java

    • Java basic

    • Java OOP

    • 应知

    • 扩展

    • IO & Stream

    • Error & Exception

    • Algorithm & Data structure

    • Design pattern

    • Web

      • Theory:World Wide Web
      • Theory:HTTP
      • Theory:HTTP URL
      • Theory:HTTP messages
      • Theory:MVC
      • Theory:Introduction to Spring Web MVC
      • Theory:REST
      • Theory:Postman
      • Theory:Getting data from REST
      • Theory:Posting and deleting data via REST
      • Theory:REST Exception handling
      • Theory:Handling requests with bodies
      • Theory:Domains
      • Theory:HTTP Basic Auth
      • Theory:IP
      • Theory:Authentication and Authorization
        • What is authentication?
        • What is authorization?
        • Authentication vs. authorization
        • Conclusion
      • Theory:OAuth
      • Theory:Java 11 HTTP client
    • Spring boot

  • 练习题

  • Frank - Java与生活

  • Frank - Java API进阶

  • 学习笔记

  • Java
  • Hyperskill - Java
  • Web
Jim
2022-10-19
目录

Theory:Authentication and Authorization

When working with data, it is important to think about protecting it to guard your privacy and avoid unauthorized access by intruders. The main tools that you can use for this are authorization and authentication. Let's take a closer look at what they are and how they work.

img

# What is authentication?

Authentication is the first step in any security process. It stands for the act of validating that users are who they claim to be. Thus, the system will "know" who is going to work with it now. The main types of authentication are as follows:

  • First of all, it is a password. If a person enters the correct username and password, the system grants them access.
  • Secondly, there are one-time pins that grant access for only one session. If your bank account has a regular password that you never change, then to protect, for example, your account data, the bank may offer you one-time pins. This level of protection is more reliable than the first, but there is a chance that someone may intercept your one-time pin.
  • The third type is an authentication app. They work as follows: first, the system fills in a password and username and then generates a long one-time access code that changes every 30 seconds making it difficult to intercept.
  • The last one is biometrics. A user presents a fingerprint or eye scan to gain access to the system. The advantage of biometric identification systems is that the characteristics used in these systems are an integral part of the personality so that it is impossible to lose, transfer, or forget them.

Authentication is always visible to the user so that they can pass it. Moreover, they can partially change it by replacing a password or their username, for example.

Often all the data during the authentication moves through an ID token, which is a formatted character string that contains information such as ID, username, account login time, ID Token expiration date.

Now you know what authentication is and what types of it exist. Let's move to the authorization then.

# What is authorization?

Authorization often goes after authentication, when the system successfully "recognized" you. Authorization checks if you have the right to access the content or resources to which you have requested access. For example, the permission to download a particular file on a server or to provide individual users with administrative access to an application.

Often all the data here moves through special access tokens, not ID ones as during authentication.

Also, unlike authentication, authorization is not visible to the user and there is no option to change it. That is because only the data owner can provide the permissions. For example, one can not view and change a document until the document owner sends a certain invitation that permits editing it.

Having figured out what authentication and authorization are, let's talk about their fundamental differences.

# Authentication vs. authorization

Let's use an analogy to outline their differences. Imagine someone asked their friend to pick up a parcel from the post office and take it to this person's house. The friend will need:

  • a key (authentication). The lock on the door will grant them access to the house, it is like a password.
  • permissions (authorization). Once inside, the friend has permission to access the living room and put the parcel on the table. But the friend may not have permission to go into the kitchen to take some food from the fridge.

Authentication and authorization work together in this example. The friend has the right to enter the house (authentication), and once there, there he gets access to certain areas of the house (authorization).

Let's put all the differences we have described into one table:

Authentication Authorization
What does it do? Verifies credentials Grants or denies permission
How does it work? Through passwords, biometrics, one-time pins, or apps Through settings maintained by security teams
Is it visible to the user? Yes No
Is it changeable by the user? Partially No
How does data move? Through ID tokens Through access tokens

# Conclusion

To sum up,

  • Authentication is the act of validating that users are who they claim to be;
  • The authentication types are password, one-time pins, authentication apps, and biometrics;
  • Authorization is the process of giving the user permission to access a specific resource or function.
编辑 (opens new window)
上次更新: 2022/10/25, 17:57:56
Theory:IP
Theory:OAuth

← Theory:IP Theory:OAuth→

最近更新
01
《挪威的森林》
04-14
02
青钢影
04-14
03
Processing strings
02-18
更多文章>
Theme by Vdoing | Copyright © 2022-2023 Jim Frank | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式