简体   繁体   English

如何为我的应用程序验证 Reddit 用户?

[英]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.

相关问题 如何使用Wordpress在Spring Web应用程序中对用户进行身份验证? - How can I use Wordpress to authenticate a user in a spring web application? 如何使用Java重新验证已在Okta应用程序下登录的用户? - How can I re-authenticate a user already signed in under an Okta application using Java? 如何通过Google Cloud Storage对Java应用程序进行身份验证? - How do I authenticate my Java application with Google Cloud Storage? 如何在我的 API 上针对 Steam 验证用户? - How do I authenticate a User on my API against Steam? 如何为我的应用程序使用geoserver的用户管理 - How can I use geoserver's user management for my application 如何在Swing应用程序中设计“用户首选项”模块? - How can I design User Preferences module in my Swing application? 如何检测用户是否是第一次使用我的应用程序? - How can I detect if a user is using my application for the first time? 如何在Spring中为系统用户验证计划进程? - How can I authenticate a system user for scheduled processes in Spring? 如何使用DaoAuthenticationProvider以编程方式使用Spring Security对用户进行身份验证 - How can I programmatically authenticate user with Spring Security using DaoAuthenticationProvider 如何在Play的2.0 WebSocket中验证用户身份? - How can I authenticate user in Play's 2.0 WebSocket?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM