<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:series="https://publishpress.com/"
	
	>
<channel>
	<title>
	Comments on: Spring Boot Oauth2 &#8211; AuthorizationServer	</title>
	<atom:link href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/</link>
	<description>기저귀 갈면서 코딩해야 프로다!</description>
	<lastBuildDate>Thu, 17 Feb 2022 09:54:02 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>
		By: subin moon		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12655</link>

		<dc:creator><![CDATA[subin moon]]></dc:creator>
		<pubDate>Tue, 26 Jan 2021 23:41:16 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12655</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12653&quot;&gt;happydaddy&lt;/a&gt;.

답변 감사합니다!
build.gradle을 고친 후 해결되었습니다. 제가 설정한 버전과 뭔가 맞지 않았나 봅니다! 감사합니다 ㅎㅎ]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12653">happydaddy</a>.</p>
<p>답변 감사합니다!<br />
build.gradle을 고친 후 해결되었습니다. 제가 설정한 버전과 뭔가 맞지 않았나 봅니다! 감사합니다 ㅎㅎ</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12653</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Tue, 26 Jan 2021 11:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12653</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12652&quot;&gt;subin moon&lt;/a&gt;.

안녕하세요.

Controller에서 Java객체를 Json으로 내보낼때 문제가 있는거 같은데요.
기본적으로 build.gradle에 spring-boot-starter-web이 포함되어있으면 converter를 따로 지정해주지 않아도 json변환엔 문제없을텐데 이상하네요.
혹시 모르니 프로젝트 왼쪽의 External Libraries에 jackson.core 모듈이 있는지 확인해 보시기 바랍니다.
혹시 Converter를 수동으로 지정한 부분이 있는지도 확인해보시기 바랍니다.

그래도 안되면 문서상에 기재된 git repository를 로컬에 다운받아 다른점을 찾아보셔야 할것 같습니다.
https://github.com/codej99/SpringOauth2AuthorizationServer.git]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12652">subin moon</a>.</p>
<p>안녕하세요.</p>
<p>Controller에서 Java객체를 Json으로 내보낼때 문제가 있는거 같은데요.<br />
기본적으로 build.gradle에 spring-boot-starter-web이 포함되어있으면 converter를 따로 지정해주지 않아도 json변환엔 문제없을텐데 이상하네요.<br />
혹시 모르니 프로젝트 왼쪽의 External Libraries에 jackson.core 모듈이 있는지 확인해 보시기 바랍니다.<br />
혹시 Converter를 수동으로 지정한 부분이 있는지도 확인해보시기 바랍니다.</p>
<p>그래도 안되면 문서상에 기재된 git repository를 로컬에 다운받아 다른점을 찾아보셔야 할것 같습니다.<br />
<a href="https://github.com/codej99/SpringOauth2AuthorizationServer.git" rel="nofollow ugc">https://github.com/codej99/SpringOauth2AuthorizationServer.git</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: subin moon		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12652</link>

		<dc:creator><![CDATA[subin moon]]></dc:creator>
		<pubDate>Mon, 25 Jan 2021 22:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12652</guid>

					<description><![CDATA[1차 테스트까지 하고 2차 테스트 하려니, 리소스 허용 후 500에러가 발생합니다.
에러 코드는 
No converter found for return value of type: class com.moon.oauth2.model.OauthToken]
OahthToken도 그대로 복사해서 가지고 왔고, 혹시나 해서 컨트롤러도 복사해 가져왔는데도 안됩니다..ㅠㅠㅠ
gson의존성도 잘 설정되었는데,,하루종일 고민해봐도 모르겠어서 댓글 남김니다 ㅠㅠ]]></description>
			<content:encoded><![CDATA[<p>1차 테스트까지 하고 2차 테스트 하려니, 리소스 허용 후 500에러가 발생합니다.<br />
에러 코드는<br />
No converter found for return value of type: class com.moon.oauth2.model.OauthToken]<br />
OahthToken도 그대로 복사해서 가지고 왔고, 혹시나 해서 컨트롤러도 복사해 가져왔는데도 안됩니다..ㅠㅠㅠ<br />
gson의존성도 잘 설정되었는데,,하루종일 고민해봐도 모르겠어서 댓글 남김니다 ㅠㅠ</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12649</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 07:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12649</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12648&quot;&gt;조우현&lt;/a&gt;.

http://localhost:8081/oauth/authorize?client_id=testClientId&amp;redirect_uri=http://localhost:8081/oauth2/callback&amp;response_type=code&amp;scope=read

위 주소를 호출했을때 로그인 화면으로 이동해서 로그인 한 후에 다시 저 페이지로 돌아가지 않고 /로 간다는 말인가요?

말해주시는 내용만으로는 추측해볼만한 단서가 없어 어떤 문제인지 알수가 없습니다.
github에서 소스를 clone받아 돌려보시고 작성하신 코드와 비교하여 문제점을 찾아보셔야 할거 같습니다.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12648">조우현</a>.</p>
<p><a href="http://localhost:8081/oauth/authorize?client_id=testClientId&#038;redirect_uri=http://localhost:8081/oauth2/callback&#038;response_type=code&#038;scope=read" rel="nofollow ugc">http://localhost:8081/oauth/authorize?client_id=testClientId&#038;redirect_uri=http://localhost:8081/oauth2/callback&#038;response_type=code&#038;scope=read</a></p>
<p>위 주소를 호출했을때 로그인 화면으로 이동해서 로그인 한 후에 다시 저 페이지로 돌아가지 않고 /로 간다는 말인가요?</p>
<p>말해주시는 내용만으로는 추측해볼만한 단서가 없어 어떤 문제인지 알수가 없습니다.<br />
github에서 소스를 clone받아 돌려보시고 작성하신 코드와 비교하여 문제점을 찾아보셔야 할거 같습니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 조우현		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12648</link>

		<dc:creator><![CDATA[조우현]]></dc:creator>
		<pubDate>Tue, 12 Jan 2021 15:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12648</guid>

					<description><![CDATA[좋은 글 감사합니다. 실습을 하고 있는데 로그인 페이지까지는 잘 넘어가는데 로그인 하고 나면 / 경로로만 가는데 혹시 예상 되는 문제가 있으실까요?]]></description>
			<content:encoded><![CDATA[<p>좋은 글 감사합니다. 실습을 하고 있는데 로그인 페이지까지는 잘 넘어가는데 로그인 하고 나면 / 경로로만 가는데 혹시 예상 되는 문제가 있으실까요?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12589</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Wed, 16 Sep 2020 10:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12589</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12585&quot;&gt;yeonnam lee&lt;/a&gt;.

안녕하세요. 해당 부분은 개발 환경 차이에 따라 안되는 부분이 있는거 같습니다.
다음 장을 확인해 보시면 bcrypt를 적용하는 부분과 There is no PasswordEncoder mapped for the id &quot;null&quot; 에러에 대한 내용이 있으니 확인해 보시기 바랍니다.
http://3.36.120.4/post/1287/spring-oauth2-authorizationserver-database/]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12585">yeonnam lee</a>.</p>
<p>안녕하세요. 해당 부분은 개발 환경 차이에 따라 안되는 부분이 있는거 같습니다.<br />
다음 장을 확인해 보시면 bcrypt를 적용하는 부분과 There is no PasswordEncoder mapped for the id &#8220;null&#8221; 에러에 대한 내용이 있으니 확인해 보시기 바랍니다.<br />
<a href="http://3.36.120.4/post/1287/spring-oauth2-authorizationserver-database/" rel="nofollow ugc">http://3.36.120.4/post/1287/spring-oauth2-authorizationserver-database/</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: yeonnam lee		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12585</link>

		<dc:creator><![CDATA[yeonnam lee]]></dc:creator>
		<pubDate>Tue, 15 Sep 2020 09:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12585</guid>

					<description><![CDATA[There is no PasswordEncoder mapped for the id &quot;null&quot; 에러
{noop}을 해도 같은 에러가 발생하는대 해결방법이있나요 ?]]></description>
			<content:encoded><![CDATA[<p>There is no PasswordEncoder mapped for the id &#8220;null&#8221; 에러<br />
{noop}을 해도 같은 에러가 발생하는대 해결방법이있나요 ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: yeonnam lee		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12583</link>

		<dc:creator><![CDATA[yeonnam lee]]></dc:creator>
		<pubDate>Tue, 15 Sep 2020 07:40:19 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12583</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12532&quot;&gt;유동관&lt;/a&gt;.

There is no PasswordEncoder mapped for the id &quot;null&quot;
auth.inMemoryAuthentication().withUser(&quot;user&quot;).password(&quot;{noop}pass&quot;).roles(&quot;USER&quot;);
이렇게 했는대도 에러가나면 어떤건가요 ... 승인누르면 에러가나네요 ㅠㅠ]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12532">유동관</a>.</p>
<p>There is no PasswordEncoder mapped for the id &#8220;null&#8221;<br />
auth.inMemoryAuthentication().withUser(&#8220;user&#8221;).password(&#8220;{noop}pass&#8221;).roles(&#8220;USER&#8221;);<br />
이렇게 했는대도 에러가나면 어떤건가요 &#8230; 승인누르면 에러가나네요 ㅠㅠ</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12545</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Mon, 13 Jul 2020 07:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12545</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12541&quot;&gt;유동관&lt;/a&gt;.

그런가요? 제 github 받아서 실행했을땐 별문제 없어서 라이브러리 버전문제인가 했습니다.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12541">유동관</a>.</p>
<p>그런가요? 제 github 받아서 실행했을땐 별문제 없어서 라이브러리 버전문제인가 했습니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 유동관		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12541</link>

		<dc:creator><![CDATA[유동관]]></dc:creator>
		<pubDate>Sun, 12 Jul 2020 22:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12541</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12537&quot;&gt;happydaddy&lt;/a&gt;.

버전은 똑같은 것을 사용했었습니다ㅠㅠ 

@Configuration
@EnableAuthorizationServer
public class Oauth2AuthorizationConfig extends AuthorizationServerConfigurerAdapter {

    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
        clients.inMemory()
                .withClient(&quot;testClientId&quot;)
                .secret(&quot;{noop}testSecret&quot;)
                .redirectUris(&quot;http://localhost:8081/oauth2/callback&quot;)
                .authorizedGrantTypes(&quot;authorization_code&quot;)
                .scopes(&quot;read&quot;, &quot;write&quot;)
                .accessTokenValiditySeconds(30000);
    }
}
에서도 마찬가지로 noop을 사용해주면 정상 동작 확인됩니다.

좋은 글, 친절한 댓글 감사합니다!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12537">happydaddy</a>.</p>
<p>버전은 똑같은 것을 사용했었습니다ㅠㅠ </p>
<p>@Configuration<br />
@EnableAuthorizationServer<br />
public class Oauth2AuthorizationConfig extends AuthorizationServerConfigurerAdapter {</p>
<p>    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {<br />
        clients.inMemory()<br />
                .withClient(&#8220;testClientId&#8221;)<br />
                .secret(&#8220;{noop}testSecret&#8221;)<br />
                .redirectUris(&#8220;http://localhost:8081/oauth2/callback&#8221;)<br />
                .authorizedGrantTypes(&#8220;authorization_code&#8221;)<br />
                .scopes(&#8220;read&#8221;, &#8220;write&#8221;)<br />
                .accessTokenValiditySeconds(30000);<br />
    }<br />
}<br />
에서도 마찬가지로 noop을 사용해주면 정상 동작 확인됩니다.</p>
<p>좋은 글, 친절한 댓글 감사합니다!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 유동관		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12532</link>

		<dc:creator><![CDATA[유동관]]></dc:creator>
		<pubDate>Fri, 10 Jul 2020 07:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12532</guid>

					<description><![CDATA[[공유]

실습 진행하다가  There is no PasswordEncoder mapped for the id &quot;null&quot; 에러를 만날 때,

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication()
                .withUser(&quot;user&quot;)
                .password(&quot;{noop}123&quot;)
                .roles(&quot;USER&quot;);
    }

부분에서 password 부분에 {noop}을 적어주면 에러가 해결됨]]></description>
			<content:encoded><![CDATA[<p>[공유]</p>
<p>실습 진행하다가  There is no PasswordEncoder mapped for the id &#8220;null&#8221; 에러를 만날 때,</p>
<p>    @Override<br />
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {<br />
        auth.inMemoryAuthentication()<br />
                .withUser(&#8220;user&#8221;)<br />
                .password(&#8220;{noop}123&#8221;)<br />
                .roles(&#8220;USER&#8221;);<br />
    }</p>
<p>부분에서 password 부분에 {noop}을 적어주면 에러가 해결됨</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 유동관		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12531</link>

		<dc:creator><![CDATA[유동관]]></dc:creator>
		<pubDate>Fri, 10 Jul 2020 07:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12531</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12530&quot;&gt;happydaddy&lt;/a&gt;.

감사합니다. 알려주신 방법대로 해결하였읍니다.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12530">happydaddy</a>.</p>
<p>감사합니다. 알려주신 방법대로 해결하였읍니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12537</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Fri, 10 Jul 2020 05:37:39 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12537</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12532&quot;&gt;유동관&lt;/a&gt;.

실습에 사용한 spring 버전이 아닌 최신 버전을 사용하면 발생하는 거 같습니다.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12532">유동관</a>.</p>
<p>실습에 사용한 spring 버전이 아닌 최신 버전을 사용하면 발생하는 거 같습니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12535</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Fri, 10 Jul 2020 03:24:55 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12535</guid>

					<description><![CDATA[response가 null이건가요?? code값이 잘 넘어오는지 확인해 보셔야 할거 같네요]]></description>
			<content:encoded><![CDATA[<p>response가 null이건가요?? code값이 잘 넘어오는지 확인해 보셔야 할거 같네요</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12530</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Thu, 09 Jul 2020 23:11:19 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12530</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12529&quot;&gt;유동관&lt;/a&gt;.

lombok 설정이 제대로 안된거 같은데요.
아래 포스팅에서 lombok 활성화 부분 확인 부탁드립니다.
http://3.36.120.4/post/1215/intellij-github-spring-gradle-project-import/

이것도 안되시면 @RequiredArgsConstructor 삭제하시고 다음과 같이 @Autowired 쓰시면 됩니다.

@Autowired
private Gson gson;
@Autowired
private RestTemplate restTemplate;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12529">유동관</a>.</p>
<p>lombok 설정이 제대로 안된거 같은데요.<br />
아래 포스팅에서 lombok 활성화 부분 확인 부탁드립니다.<br />
<a href="http://3.36.120.4/post/1215/intellij-github-spring-gradle-project-import/" rel="nofollow ugc">http://3.36.120.4/post/1215/intellij-github-spring-gradle-project-import/</a></p>
<p>이것도 안되시면 @RequiredArgsConstructor 삭제하시고 다음과 같이 @Autowired 쓰시면 됩니다.</p>
<p>@Autowired<br />
private Gson gson;<br />
@Autowired<br />
private RestTemplate restTemplate;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 유동관		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12529</link>

		<dc:creator><![CDATA[유동관]]></dc:creator>
		<pubDate>Thu, 09 Jul 2020 22:20:46 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12529</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12528&quot;&gt;happydaddy&lt;/a&gt;.

&lt;code&gt;
@RequiredArgsConstructor
@RestController
@RequestMapping(&quot;/oauth2&quot;)
public class Oauth2Controller {

    private final Gson gson;
    private final RestTemplate restTemplate;

    @GetMapping(value = &quot;/callback&quot;)
    public OAuthToken callbackSocial(@RequestParam String code) {

        String credentials = &quot;testClientId:testSecret&quot;;
        String encodedCredentials = new String(Base64.encodeBase64(credentials.getBytes()));

        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
        headers.add(&quot;Authorization&quot;, &quot;Basic &quot; + encodedCredentials);

        MultiValueMap&lt;String, String&gt; params = new LinkedMultiValueMap&lt;&gt;();
        params.add(&quot;code&quot;, code);
        params.add(&quot;grant_type&quot;, &quot;authorization_code&quot;);
        params.add(&quot;redirect_uri&quot;, &quot;http://localhost:8081/oauth2/callback&quot;);
        HttpEntity&lt;MultiValueMap&lt;String, String&gt;&gt; request = new HttpEntity&lt;&gt;(params, headers);
        ResponseEntity&lt;String&gt; response = restTemplate.postForEntity(&quot;http://localhost:8081/oauth/token&quot;, request, String.class);
        if (response.getStatusCode() == HttpStatus.OK) {
            return gson.fromJson(response.getBody(), OAuthToken.class);
        }
        return null;
    }
}
&lt;/code&gt;

부분에서     private final Gson gson; private final RestTemplate restTemplate; 이 빨간 줄로 에러를 뿜었습니다. 살펴보니 생성자를 생성해주어야한다고 했는데 제가 알기로 @RequiredArgsConstructor 어노테이션이 알아서 생성자를 생성해주는 것으로 알고 있는데, 혹시 따로 생성자 코드를 작성해야하나 싶어 작성했지만 역시나 작동하지 않는 상태였습니다. 

해결법으로 private final Gson gson = new Gson(); 으로 코드를 수정하였는데, 온전하지 않은 방법인 것 같아서 질문드립니다.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12528">happydaddy</a>.</p>
<p><code><br />
@RequiredArgsConstructor<br />
@RestController<br />
@RequestMapping("/oauth2")<br />
public class Oauth2Controller {</p>
<p>    private final Gson gson;<br />
    private final RestTemplate restTemplate;</p>
<p>    @GetMapping(value = "/callback")<br />
    public OAuthToken callbackSocial(@RequestParam String code) {</p>
<p>        String credentials = "testClientId:testSecret";<br />
        String encodedCredentials = new String(Base64.encodeBase64(credentials.getBytes()));</p>
<p>        HttpHeaders headers = new HttpHeaders();<br />
        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);<br />
        headers.add("Authorization", "Basic " + encodedCredentials);</p>
<p>        MultiValueMap<String, String> params = new LinkedMultiValueMap<>();<br />
        params.add("code", code);<br />
        params.add("grant_type", "authorization_code");<br />
        params.add("redirect_uri", "http://localhost:8081/oauth2/callback");<br />
        HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);<br />
        ResponseEntity<string> response = restTemplate.postForEntity("http://localhost:8081/oauth/token", request, String.class);<br />
        if (response.getStatusCode() == HttpStatus.OK) {<br />
            return gson.fromJson(response.getBody(), OAuthToken.class);<br />
        }<br />
        return null;<br />
    }<br />
}<br />
</string></code></p>
<p>부분에서     private final Gson gson; private final RestTemplate restTemplate; 이 빨간 줄로 에러를 뿜었습니다. 살펴보니 생성자를 생성해주어야한다고 했는데 제가 알기로 @RequiredArgsConstructor 어노테이션이 알아서 생성자를 생성해주는 것으로 알고 있는데, 혹시 따로 생성자 코드를 작성해야하나 싶어 작성했지만 역시나 작동하지 않는 상태였습니다. </p>
<p>해결법으로 private final Gson gson = new Gson(); 으로 코드를 수정하였는데, 온전하지 않은 방법인 것 같아서 질문드립니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12528</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Thu, 09 Jul 2020 21:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12528</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12527&quot;&gt;유동관&lt;/a&gt;.

안녕하세요.
개발 환경 및 에러 내용을 좀 더 자세히 알 수 있을까요? 
알려주신 내용만으로는 어떤 문제인지 알수가 없습니다.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12527">유동관</a>.</p>
<p>안녕하세요.<br />
개발 환경 및 에러 내용을 좀 더 자세히 알 수 있을까요?<br />
알려주신 내용만으로는 어떤 문제인지 알수가 없습니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 유동관		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12527</link>

		<dc:creator><![CDATA[유동관]]></dc:creator>
		<pubDate>Thu, 09 Jul 2020 21:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12527</guid>

					<description><![CDATA[@disqus_Iw723GnZPj:disqus   
안녕하세요, 좋은 글 잘봤습니다.
구현을 하다가 한가지 의문이 생기게 되어 질문을 드립니다.

controller 부분을 구현하다가 private final 설정을 해주었는데 생성자 오류가 발생하여 질문드립니다. @RequiredArgsConstructor를 적용시켰는데도 에러가 나니까 이유를 모르겠네요,,! 쉽고 자세한 설명글 감사합니다.]]></description>
			<content:encoded><![CDATA[<p>@disqus_Iw723GnZPj:disqus<br />
안녕하세요, 좋은 글 잘봤습니다.<br />
구현을 하다가 한가지 의문이 생기게 되어 질문을 드립니다.</p>
<p>controller 부분을 구현하다가 private final 설정을 해주었는데 생성자 오류가 발생하여 질문드립니다. @RequiredArgsConstructor를 적용시켰는데도 에러가 나니까 이유를 모르겠네요,,! 쉽고 자세한 설명글 감사합니다.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: happydaddy		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12526</link>

		<dc:creator><![CDATA[happydaddy]]></dc:creator>
		<pubDate>Tue, 30 Jun 2020 08:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12526</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12525&quot;&gt;개발하는 학생&lt;/a&gt;.

안녕하세요. 반갑습니다.
1. 클라이언트는 auth 서버(ex 페이스북)에 등록된 회사나 앱이라고 생각하시면 됩니다. 예를 들면 게임할 때 카카오 연동이 돼있으면 최초 로그인할 때 이 앱에 회원 정보 제공하고 게임 계속할 거냐고 물어보잖아요? 여기서 서비스를 제공하는 주체(회사나 앱)를 클라이언트라 하고 auth서버가 이 클라이언트한테 제공한 비밀키가 secret입니다. auth서버에 클라이언트가 하나 등록돼 있고 회원이 auth서버에 로그인하고 앱 승인하면 클라이언트의 서비스와 회원정보가 연결된다고 보시면 됩니다(1:N이 되겠네요)

2. 사용자별 아닌 건 위에서 설명했고요.
액세스 토큰은 발급받을 때 리프레시 토큰도 같이 받을 수 있어요. 액세스 토큰이 만료되면 리프레시 토큰으로 다시 액세스 토큰을 발급받을 수 있습니다. 회원이 재로그인 안 해도 돼요. 재 로그인해야 하는 경우는 리프레시 토큰도 만료된 경우입니다.

적절한 답변이 되었는지 모르겠네요~저도 공부만 했지 서비스엔 적용한 적이 없어서요. 그래도 더 물어보실 게 있으면 질문 올려주세요~]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12525">개발하는 학생</a>.</p>
<p>안녕하세요. 반갑습니다.<br />
1. 클라이언트는 auth 서버(ex 페이스북)에 등록된 회사나 앱이라고 생각하시면 됩니다. 예를 들면 게임할 때 카카오 연동이 돼있으면 최초 로그인할 때 이 앱에 회원 정보 제공하고 게임 계속할 거냐고 물어보잖아요? 여기서 서비스를 제공하는 주체(회사나 앱)를 클라이언트라 하고 auth서버가 이 클라이언트한테 제공한 비밀키가 secret입니다. auth서버에 클라이언트가 하나 등록돼 있고 회원이 auth서버에 로그인하고 앱 승인하면 클라이언트의 서비스와 회원정보가 연결된다고 보시면 됩니다(1:N이 되겠네요)</p>
<p>2. 사용자별 아닌 건 위에서 설명했고요.<br />
액세스 토큰은 발급받을 때 리프레시 토큰도 같이 받을 수 있어요. 액세스 토큰이 만료되면 리프레시 토큰으로 다시 액세스 토큰을 발급받을 수 있습니다. 회원이 재로그인 안 해도 돼요. 재 로그인해야 하는 경우는 리프레시 토큰도 만료된 경우입니다.</p>
<p>적절한 답변이 되었는지 모르겠네요~저도 공부만 했지 서비스엔 적용한 적이 없어서요. 그래도 더 물어보실 게 있으면 질문 올려주세요~</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 개발하는 학생		</title>
		<link>https://www.daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/#comment-12525</link>

		<dc:creator><![CDATA[개발하는 학생]]></dc:creator>
		<pubDate>Tue, 30 Jun 2020 05:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://3.36.120.4/?p=1239#comment-12525</guid>

					<description><![CDATA[안녕하세요, 좋은 글 잘봤습니다.
구현을 하다가 한가지 의문이 생기게 되어 질문을 드립니다.

1. client를 사용자별로 관리를 해야 하는지 궁금합니다.
    예제에서는 testClientId:testSecret 를 이용하여 client를 하나로 설정하고 basic 토큰을 이용해서 access token을 발급해주는 형식으로 진행하였는데, 실제 실무에서는 어떻게 진행하는지 궁금합니다.

2. 만약 사용자별로  client를 관리한다면 access token을 재발급 받으려면 다시 credential을 받아야 하는데 이때 access token 만료 시간이 5분이라면 credential을 받기 위해 5분마다 다시 로그인을 해서 다시 basic 토큰으로 access token을 재발급 받아야 하나요?]]></description>
			<content:encoded><![CDATA[<p>안녕하세요, 좋은 글 잘봤습니다.<br />
구현을 하다가 한가지 의문이 생기게 되어 질문을 드립니다.</p>
<p>1. client를 사용자별로 관리를 해야 하는지 궁금합니다.<br />
    예제에서는 testClientId:testSecret 를 이용하여 client를 하나로 설정하고 basic 토큰을 이용해서 access token을 발급해주는 형식으로 진행하였는데, 실제 실무에서는 어떻게 진행하는지 궁금합니다.</p>
<p>2. 만약 사용자별로  client를 관리한다면 access token을 재발급 받으려면 다시 credential을 받아야 하는데 이때 access token 만료 시간이 5분이라면 credential을 받기 위해 5분마다 다시 로그인을 해서 다시 basic 토큰으로 access token을 재발급 받아야 하나요?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
