首页 > 解决方案 > 如何在 SpringBoot 应用程序中获取授权码

问题描述

我有一个 SpringBoot 应用程序(仅提供 API,无 UI),它消耗(连接)JIRA API 并将 json 响应发送回客户端。现在我们正在实施 OAuth2 来签署 JIRA 以访问 Jira 资源。

为此,首先我需要发送Authorization Code以获取Access Code。据我所知,在以下 GET URL 的浏览器提示上提交用户/密码后,授权代码将从重定向 url 获取。

https://auth.atlassian.com/authorize?audience=api.atlassian.com&client_id={my client id}&scope={copseABC}&redirect_uri=http%3A%2F%2Flocalhost%3A8080&state=itsmychoice&response_type=code&prompt=consent

但在我的场景中,执行此过程不涉及 UI/浏览器。如何使用 java 代码获取授权码。

标签: oauth-2.0authorizationjira-rest-api

解决方案


推荐阅读