-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
196 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ public class MemberService { | |
|
||
private final MemberRepository memberRepository; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/Journey/Together/global/security/naver/dto/NaverProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package Journey.Together.global.security.naver.dto; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.util.UriComponentsBuilder; | ||
|
||
@Data | ||
@Configuration | ||
@ConfigurationProperties(prefix = "naver") | ||
public class NaverProperties { | ||
private String requestTokenUri; | ||
private String clientId; | ||
private String clientSecret; | ||
|
||
public String getRequestURL(String code) { | ||
return UriComponentsBuilder.fromHttpUrl(requestTokenUri) | ||
.queryParam("grant_type", "authorization_code") | ||
.queryParam("client_id", clientId) | ||
.queryParam("client_secret", clientSecret) | ||
.queryParam("code", code) | ||
.toUriString(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/Journey/Together/global/security/naver/dto/NaverTokenResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package Journey.Together.global.security.naver.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class NaverTokenResponse { | ||
@JsonProperty("access_token") | ||
private String accessToken; | ||
@JsonProperty("refresh_token") | ||
private String refreshToken; | ||
@JsonProperty("token_type") | ||
private String tokenType; | ||
@JsonProperty("expires_in") | ||
private String expiresIn; | ||
@JsonProperty("error") | ||
private String error; | ||
@JsonProperty("error_description") | ||
private String errorDescription; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/Journey/Together/global/security/naver/dto/NaverUserResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package Journey.Together.global.security.naver.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class NaverUserResponse { | ||
@JsonProperty("resultcode") | ||
private String resultCode; | ||
@JsonProperty("message") | ||
private String message; | ||
@JsonProperty("response") | ||
private NaverUserDetail naverUserDetail; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class NaverUserDetail { | ||
private String id; | ||
private String name; | ||
private String email; | ||
private String nickname; | ||
private String profile_image; | ||
} | ||
} |