In a Node.js application using OAuth 2.0, what is the main purpose of the access token?
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng: "To allow the client to access protected resources on behalf of the user". Trong OAuth 2.0, sau khi người dùng đồng ý trên authorization server, ứng dụng client nhận access token (mã truy cập) và gửi nó trong header Authorization dạng Bearer khi gọi resource server; token mang phạm vi quyền (scope) và thời hạn ngắn, cho phép client thay mặt người dùng truy cập tài nguyên được bảo vệ mà không cần biết mật khẩu của họ. "To store user credentials securely on the server" sai vì mục đích của OAuth là tránh việc chia sẻ thông tin đăng nhập, token không phải nơi chứa mật khẩu. "To validate the client’s redirect URI during authorization" là việc authorization server tự làm bằng cách so redirect URI với danh sách đã đăng ký, diễn ra trước khi có access token. "To refresh the user’s session without re-authentication" là vai trò của refresh token, loại token dùng để xin access token mới khi token cũ hết hạn.
Cùng chương 9
Which of the following is a standard security protocol used for secure communication over the internet?Có lời giảiCâu hỏiWhich HTTP header is used to pass the OAuth token in requests?Có lời giảiCâu hỏiWhat are the benefits of using HTTPS in a Node.js application? (Choose 3 answers)Có lời giảiCâu hỏiCả 30 câu của chủ đề30 câu