Itsurran
Itsurran
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
in my user entity
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
but i think the biggest problem was this
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return List.of();
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return List.of();
}
i changed it to
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return role.getAuthorities();
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return role.getAuthorities();
}
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
like my own roles etc
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
followed Bouali Ali video on youtube where he explained everything and i just followed but did my own way
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
got it working
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.springframework.security.core.userdetails;

import java.io.Serializable;
import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;

public interface UserDetails extends Serializable {
Collection<? extends GrantedAuthority> getAuthorities();

String getPassword();

String getUsername();

default boolean isAccountNonExpired() {
return true;
}

default boolean isAccountNonLocked() {
return true;
}

default boolean isCredentialsNonExpired() {
return true;
}

default boolean isEnabled() {
return true;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.springframework.security.core.userdetails;

import java.io.Serializable;
import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;

public interface UserDetails extends Serializable {
Collection<? extends GrantedAuthority> getAuthorities();

String getPassword();

String getUsername();

default boolean isAccountNonExpired() {
return true;
}

default boolean isAccountNonLocked() {
return true;
}

default boolean isCredentialsNonExpired() {
return true;
}

default boolean isEnabled() {
return true;
}
}
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
No
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
HMM
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
User admin = User.builder() .username(adminUsername) .firstname("Admin") .lastname("User") .email("[email protected]") .password(passwordEncoder.encode("Admin123!")) .socialSecurityNumber("0000000000") .phoneNumber("+46123456789") .street("Default Street 123") .city("Default City") .role(Role.ADMIN) .registrationStatus(RegistrationStatus.APPROVED) .createdAt(LocalDateTime.now()) .build();
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
and i can authenticate
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
i already have
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
think we need backup danial
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
hmmm not working
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
i have a /me that gets the currentuser and by that you need a cookie
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
wait
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
lmfao
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
i don't have anything about invite in my adminservice
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
l0l
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
ahaaa i think iknow it
57 replies
JCHJava Community | Help. Code. Learn.
Created by Itsurran on 2/6/2025 in #java-help
Roles & SecurityConfig
but as i said i think its either not reconizing the session aka role to send that invite post or some bullshit in config right?
57 replies