使用nodejs验证API [英] Authenticate an API with nodejs

查看:179
本文介绍了使用nodejs验证API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在NodeJS模块中验证API。但我不知道如何确保这是一个有效的密钥。对于使用Steam API的其他一些功能,我需要这个。



我尝试过:



I need to authenticate an API in my NodeJS module. But I do not know how to actually make sure this is a valid key. I need this for some other functions which uses the Steam API.

What I have tried:

login = (apiKey) => {}

推荐答案

为保护您的API,强烈建议您在需要保护的API上使用oAuth身份验证。可以通过调用客户端应用程序来访问受保护的API资源,然后执行标准oAuth身份验证过程。您还可以在API上实现基本身份验证,客户端应用程序需要在HTTP头中传递身份验证详细信息。
To protect your APIs it is highly recommended to use oAuth authentication on your APIs which you need to protect. Standard oAuth authentication process can be followed by calling client apps to access the protected API resources. Also you can implement Basic Authentication on your APIs for which client apps will need to pass authentication details in the HTTP headers.


这篇关于使用nodejs验证API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆