[英]How can I authenticate a Reddit user for my application?
I am making a desktop application for Reddit in Java.我正在用 Java 为 Reddit 制作一个桌面应用程序。 I want to let users log in to their Reddit account via my application so that they can do things on Reddit.
我想让用户通过我的应用程序登录他们的 Reddit 帐户,以便他们可以在 Reddit 上做事。 I know that I need to get access tokens and whatnot but I don't know how to go through the process of doing that.
我知道我需要获得访问令牌等等,但我不知道如何完成这个过程。 Whenever I have accessed the API previously, it has been in Python using PRAW, so I would manually enter in the client id and client secret - obviously I can't be doing this for a professional application.
每当我以前访问过 API 时,它都是使用 PRAW 在 Python 中进行的,因此我会手动输入客户端 ID 和客户端密码 - 显然我不能为专业应用程序执行此操作。 I'd appreciate it if anyone would guide me through the process of authenticating the user and how to receive and use the access token.
如果有人能指导我完成对用户进行身份验证以及如何接收和使用访问令牌的过程,我将不胜感激。
You have to use oauth apis.您必须使用 oauth api。 There is a sample integration for reddit.
reddit 有一个示例集成。 https://www.e4developer.com/2018/11/04/reddit-api-authentication-with-java-spring/
https://www.e4developer.com/2018/11/04/reddit-api-authentication-with-java-spring/
also there are developer guide for oauth in reddit page https://reddit.com/dev/api/oauth在 reddit 页面https://reddit.com/dev/api/oauth 中还有 oauth 的开发者指南
Reddit github page have good documentation https://github.com/reddit-archive/reddit/wiki/OAuth2 Reddit github 页面有很好的文档https://github.com/reddit-archive/reddit/wiki/OAuth2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.