今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Using authorization tokens
- [Instructor] In the last video, I showed you how to use basic auth in an API request. There are some downsides to that type of authentication though, and so it has become much more common for APIs to use some form of an authorization token instead. These tokens combine together both authentication and authorization. In essence, the server says, anyone who presents me with this token is allowed to do the things that this token has been set up to do. So, let's take a look at an example of this in practice. If I log into GitHub, I can go to the developer settings in my account, go to personal access tokens and generate a new token. Now, this token can have an expiration for how long it's valid for, and then we can pick different endpoints and actions that this token should be allowed to use. So, I'll give it full access to the repos endpoint here, which means that I should be able to read information about all my repos, as…