feat(auth): add oauth2 using github (CAS-64) #208

Merged
csimonis merged 9 commits from feat/github-oauth into main 2025-05-21 09:03:44 +00:00
12 changed files with 12 additions and 12 deletions
Showing only changes of commit 75de7d1370 - Show all commits

View file

@ -6,4 +6,4 @@ public class OAuth2AuthenticationProcessingException extends AuthenticationExcep
public OAuth2AuthenticationProcessingException(String msg) { public OAuth2AuthenticationProcessingException(String msg) {
super(msg); super(msg);
} }
} }

View file

@ -46,4 +46,4 @@ public class GitHubController {
AuthResponseDto response = githubService.processGithubCode(code); AuthResponseDto response = githubService.processGithubCode(code);
return ResponseEntity.ok(response); return ResponseEntity.ok(response);
} }
} }

View file

@ -162,4 +162,4 @@ public class GitHubService {
throw new RuntimeException("Failed to process GitHub authentication", e); throw new RuntimeException("Failed to process GitHub authentication", e);
} }
} }
} }

View file

@ -5,4 +5,4 @@ import lombok.Data;
@Data @Data
public class GithubCallbackDto { public class GithubCallbackDto {
private String code; private String code;
} }

View file

@ -102,4 +102,4 @@ public class CustomOAuth2UserService extends DefaultOAuth2UserService {
} }
return userRepository.save(existingUser); return userRepository.save(existingUser);
} }
} }

View file

@ -22,4 +22,4 @@ public class GitHubOAuth2UserInfo extends OAuth2UserInfo {
public String getEmail() { public String getEmail() {
return (String) attributes.get("email"); return (String) attributes.get("email");
} }
} }

View file

@ -52,4 +52,4 @@ public class OAuth2AuthenticationSuccessHandler extends SimpleUrlAuthenticationS
.queryParam("token", token) .queryParam("token", token)
.build().toUriString(); .build().toUriString();
} }
} }

View file

@ -12,4 +12,4 @@ public class OAuth2Config {
public PasswordEncoder oauth2PasswordEncoder() { public PasswordEncoder oauth2PasswordEncoder() {
return new BCryptPasswordEncoder(); return new BCryptPasswordEncoder();
} }
} }

View file

@ -17,4 +17,4 @@ public abstract class OAuth2UserInfo {
public abstract String getName(); public abstract String getName();
public abstract String getEmail(); public abstract String getEmail();
} }

View file

@ -14,4 +14,4 @@ public class OAuth2UserInfoFactory {
throw new OAuth2AuthenticationProcessingException("Sorry! Login with " + registrationId + " is not supported yet."); throw new OAuth2AuthenticationProcessingException("Sorry! Login with " + registrationId + " is not supported yet.");
} }
} }
} }

View file

@ -99,4 +99,4 @@ public class UserPrincipal implements OAuth2User, UserDetails {
public String getName() { public String getName() {
return String.valueOf(id); return String.valueOf(id);
} }
} }

View file

@ -3,4 +3,4 @@ package de.szut.casino.user;
public enum AuthProvider { public enum AuthProvider {
LOCAL, LOCAL,
GITHUB GITHUB
} }