-
Notifications
You must be signed in to change notification settings - Fork 2
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
7 changed files
with
112 additions
and
34 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
1 change: 1 addition & 0 deletions
1
src/main/java/com/mpnp/baechelin/oauth/common/AuthResponseHeader.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
42 changes: 42 additions & 0 deletions
42
src/main/java/com/mpnp/baechelin/oauth/controller/AuthController.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,42 @@ | ||
package com.mpnp.baechelin.oauth.controller; | ||
|
||
import com.mpnp.baechelin.config.properties.AppProperties; | ||
import com.mpnp.baechelin.oauth.common.AuthResponse; | ||
import com.mpnp.baechelin.oauth.entity.RoleType; | ||
import com.mpnp.baechelin.oauth.service.AuthService; | ||
import com.mpnp.baechelin.oauth.token.AuthToken; | ||
import com.mpnp.baechelin.oauth.token.AuthTokenProvider; | ||
import com.mpnp.baechelin.user.entity.user.UserRefreshToken; | ||
import com.mpnp.baechelin.user.repository.UserRefreshTokenRepository; | ||
import com.mpnp.baechelin.util.CookieUtil; | ||
import com.mpnp.baechelin.util.HeaderUtil; | ||
import io.jsonwebtoken.Claims; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.servlet.http.Cookie; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.transaction.Transactional; | ||
import java.util.Date; | ||
|
||
@RestController | ||
@RequestMapping("/auth") | ||
@RequiredArgsConstructor | ||
public class AuthController { | ||
|
||
private final AuthService authService; | ||
|
||
/** | ||
* access token 만료시 refresh 토큰 요청 | ||
* @param request | ||
* @param response | ||
* @return | ||
*/ | ||
@GetMapping("/refresh") | ||
public AuthResponse refreshToken (HttpServletRequest request, HttpServletResponse response) { | ||
return authService.refreshToken(request, response); | ||
} | ||
} |
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