<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by abhishek raj on Medium]]></title>
        <description><![CDATA[Stories by abhishek raj on Medium]]></description>
        <link>https://medium.com/@meabhishekforyou?source=rss-3a8733093950------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*skak7XtfRMqQLJ7fEsSOhA.jpeg</url>
            <title>Stories by abhishek raj on Medium</title>
            <link>https://medium.com/@meabhishekforyou?source=rss-3a8733093950------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:09:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meabhishekforyou/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Security Context and session Management Spring security]]></title>
            <link>https://medium.com/@meabhishekforyou/security-context-and-session-management-spring-security-d853cf5dccb3?source=rss-3a8733093950------2</link>
            <guid isPermaLink="false">https://medium.com/p/d853cf5dccb3</guid>
            <category><![CDATA[java-spring-boot]]></category>
            <category><![CDATA[security-context]]></category>
            <category><![CDATA[http-session]]></category>
            <category><![CDATA[session-management]]></category>
            <category><![CDATA[spring-security]]></category>
            <dc:creator><![CDATA[abhishek raj]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 11:37:42 GMT</pubDate>
            <atom:updated>2026-07-12T11:37:42.089Z</atom:updated>
            <content:encoded><![CDATA[<h3>Authentication</h3><p>Represents the authenticated user. Contains principal, credentials, authorities and authentication status.</p><pre>public interface Authentication extends Principal {<br><br>    Collection&lt;? extends GrantedAuthority&gt; getAuthorities();<br><br>    Object getCredentials();<br><br>    Object getDetails();<br><br>    Object getPrincipal();<br><br>    boolean isAuthenticated();<br><br>}</pre><h3>SecurityContext:</h3><p>Once authentication object is created after successful authentication spring has to store this authentication object for further requests so that they don’t have to go through entire authentication flow again. This is where securityContext comes in the picture . Is is a container that stores the current Authentication object.</p><pre>public interface SecurityContext {<br>Authentication getAuthentication();<br>void setAuthentication(Authentication authentication);<br>}<br><br>//this is how SecurityContext is created<br>SecurityContext context = SecurityContextHolder.createEmptyContext();<br>//sets the authentication <br>context.setAuthentication(authentication);</pre><h3>SecurityContextHolder</h3><p>Static helper that provides access to the current SecurityContext.</p><h3>2. Relationship</h3><p>SecurityContextHolder -&gt; SecurityContext -&gt; Authentication</p><h3>3. Why ThreadLocal?</h3><ul><li>Ensures <strong>each HTTP request has its own isolated security information</strong>.</li><li>Provides <strong>thread-specific storage</strong> for the SecurityContext and Authentication.</li><li>Prevents one user’s authentication data from being shared or overwritten by another user’s request.</li><li>Allows filters, controllers, and services to access the current authenticated user via SecurityContextHolder.</li><li>Ensures <strong>thread safety</strong>, <strong>data isolation</strong>, and <strong>fast access</strong> to authentication information throughout the request lifecycle.</li></ul><h3>4. After Successful Authentication</h3><p>Spring conceptually stores the authenticated user as follows</p><pre>SecurityContext context = SecurityContextHolder.createEmptyContext();<br> context.setAuthentication(authentication);<br> SecurityContextHolder.setContext(context);</pre><h3>5. The Limitation of ThreadLocal</h3><p>ThreadLocal lives only for the lifetime of the current request. Without persistence, the user would have to authenticate again on every request.</p><h3>6. SecurityContextRepository</h3><p>SecurityContextRepository loads the SecurityContext at the beginning of a request and saves it before the response completes.</p><h3>Default Implementation</h3><p>HttpSessionSecurityContextRepository stores the SecurityContext inside the HttpSession.</p><h3>7. Session Based Flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAXGPFprbIWyrbWwmPu9fQ.png" /></figure><h3>8. Why Session + ThreadLocal?</h3><p>· HttpSession preserves authentication across requests.</p><p>· ThreadLocal provides fast access during the current request.</p><p>· Authentication is loaded once into ThreadLocal and reused.</p><h3>9. SessionCreationPolicy</h3><p>SessionCreationPolicy is an enum provided by Spring Security that controls <strong>whether Spring Security should create, use, or ignore an HTTP session</strong> for storing the SecurityContext.</p><p>It is configured as:</p><pre>http<br>    .sessionManagement(session -&gt; session<br>        .sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)<br>    );<br><br></pre><p>There are <strong>four</strong> policies:</p><ol><li>ALWAYS</li><li>IF_REQUIRED</li><li>NEVER</li><li>STATELESS</li></ol><h3>Why do we need SessionCreationPolicy?</h3><p>After successful authentication, Spring Security creates an Authentication object and stores it in the SecurityContext.</p><p>The next question is:</p><blockquote><strong><em>Where should Spring store the SecurityContext after the request is complete?</em></strong></blockquote><p>The answer depends on the application’s requirements.</p><p>For example:</p><ul><li>Traditional Web Application → HttpSession</li><li>REST API using JWT → No Session</li><li>Legacy Applications → Existing Session</li></ul><p>SessionCreationPolicy tells Spring Security <strong>how to handle HttpSession</strong>.</p><pre>@Service<br>@RequiredArgsConstructor<br>public class AuthenticationService {<br><br>    private final AuthenticationManager authenticationManager;<br>    private final SecurityContextRepository securityContextRepository;<br><br><br>    public Authentication authenticate(LoginRequest request ,<br>                                       HttpServletRequest httpServletRequest,<br>                                       HttpServletResponse httpServletResponse<br><br>    ) {<br><br>        Authentication authentication = authenticationManager.authenticate(<br>                        new UsernamePasswordAuthenticationToken(request.getUsername(),<br>                                request.getPassword()<br>                        ));<br><br>        SecurityContext context = SecurityContextHolder.createEmptyContext();<br>        //this tells for this request this is the logged in user<br>        context.setAuthentication(authentication);<br>        //here ,first spring will create session object and store the securitycontext to it<br>        //and along with response cokkie is sent which will contain the jsessionId<br>        //next request use the JsessionId to get the session object and Authenticaion obj<br>        securityContextRepository.saveContext(context, httpServletRequest, httpServletResponse );<br><br><br>        //when this request finishes the threadlocal will be cleared that&#39;s why securityContextRepository<br>        return authentication;<br>    }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KB257LCd_mBx1926k_3FVg.png" /><figcaption>responsibillites of tomcat and spring</figcaption></figure><h3>10. JWT vs Session</h3><p>Session Authentication stores SecurityContext in HttpSession.<br> JWT Authentication recreates Authentication from the JWT on every request and typically uses SessionCreationPolicy.STATELESS.</p><p>I have created a spring boot project that will demonstrate this concept.<br>please checkout to the httpSessionSecurityContextRepository branch to get the code .</p><p><a href="https://github.com/abhi220697/Hibernate-Practice">GitHub - abhi220697/Hibernate-Practice: This is a practice app for spring boot learning</a></p><h3>11. Interview Questions</h3><p>· What is SecurityContext?</p><p>· What is SecurityContextHolder?</p><p>· Why ThreadLocal?</p><p>· Why is ThreadLocal not enough?</p><p>· What is SecurityContextRepository?</p><p>· What is HttpSessionSecurityContextRepository?</p><p>· Why STATELESS for JWT?</p><p>· How does Authentication reach the controller?</p><h3>12. Key Takeaways</h3><p>· Authentication represents the logged-in user.</p><p>· SecurityContext stores Authentication.</p><p>· SecurityContextHolder provides access to SecurityContext.</p><p>· ThreadLocal isolates each user’s security context.</p><p>· SecurityContextRepository persists SecurityContext across requests.</p><p>· JWT avoids session persistence and rebuilds Authentication each request.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d853cf5dccb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Security RoadMap]]></title>
            <link>https://medium.com/@meabhishekforyou/spring-security-roadmap-9f66139b15d4?source=rss-3a8733093950------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f66139b15d4</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-security-roadmap]]></category>
            <category><![CDATA[spring-security-topics]]></category>
            <category><![CDATA[spring-security-basics]]></category>
            <category><![CDATA[spring-security]]></category>
            <dc:creator><![CDATA[abhishek raj]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 05:58:04 GMT</pubDate>
            <atom:updated>2026-07-11T05:58:04.413Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi all , this is the second article on spring security . If you have not gone through my first article <a href="https://medium.com/@meabhishekforyou/spring-security-introduction-eb50b8a6a54e">refer this</a><br> <a href="https://medium.com/@meabhishekforyou/spring-security-introduction-eb50b8a6a54e"><br></a>I have created A detailed roadmap to master Spring Security from authentication to enterprise security.</p><h3>Module 1 — Authentication Fundamentals (Completed)</h3><p>Topics to master:</p><p>· Architecture</p><p>· Authentication vs Authorization</p><p>· SecurityFilterChain</p><p>· AuthenticationManager</p><p>· AuthenticationConfiguration</p><p>· ProviderManager</p><p>· AuthenticationProvider</p><p>· DaoAuthenticationProvider</p><p>· UserDetails</p><p>· UserDetailsService</p><p>· PasswordEncoder</p><p>· UsernamePasswordAuthenticationToken</p><p>· Custom login</p><p>· Database authentication</p><h3>Module 2 — SecurityContext &amp; SecurityContextHolder</h3><p>Topics to master:</p><p>· SecurityContext</p><p>· SecurityContextHolder</p><p>· Authentication</p><p>· Principal</p><p>· GrantedAuthority</p><p>· ThreadLocal</p><p>· SecurityContextRepository</p><p>· Authentication persistence</p><p>· @AuthenticationPrincipal</p><p>· Current user retrieval</p><p>Focus: Learn where Spring stores the authenticated user after login and how every request retrieves it.</p><h3>Module 3 — Authorization</h3><p>Topics to master:</p><p>· Roles vs Authorities</p><p>· GrantedAuthority</p><p>· AuthorizationManager</p><p>· URL security</p><p>· Role hierarchy</p><p>· hasRole</p><p>· hasAuthority</p><p>· Access denied</p><h3>Module 4 — Filters &amp; Filter Chain</h3><p>Topics to master:</p><p>· DelegatingFilterProxy</p><p>· FilterChainProxy</p><p>· SecurityFilterChain</p><p>· Default filters</p><p>· UsernamePasswordAuthenticationFilter</p><p>· BearerTokenAuthenticationFilter</p><p>· ExceptionTranslationFilter</p><p>· AuthorizationFilter</p><p>· Custom OncePerRequestFilter</p><p>Focus: Understand the complete filter execution order before learning JWT.</p><h3>Module 5 — JWT</h3><p>Topics to master:</p><p>· JWT structure</p><p>· Claims</p><p>· Signing</p><p>· Validation</p><p>· Access token</p><p>· Refresh token</p><p>· JWT filter</p><p>· Stateless authentication</p><p>Focus: Implement stateless authentication using JWT and SecurityContextHolder.</p><h3>Module 6 — Method Security</h3><p>Topics to master:</p><p>· @EnableMethodSecurity</p><p>· @PreAuthorize</p><p>· @PostAuthorize</p><p>· @Secured</p><p>· @RolesAllowed</p><p>· SpEL</p><h3>Module 7 — Session Management</h3><p>Topics to master:</p><p>· SessionCreationPolicy</p><p>· Remember Me</p><p>· Concurrent sessions</p><p>· Session fixation</p><p>· Stateful vs Stateless</p><h3>Module 8 — Exception Handling</h3><p>Topics to master:</p><p>· AuthenticationEntryPoint</p><p>· AccessDeniedHandler</p><p>· Failure/Success handlers</p><h3>Module 9 — CSRF &amp; CORS</h3><p>Topics to master:</p><p>· CSRF</p><p>· Synchronizer Token</p><p>· When to disable</p><p>· CORS</p><p>· Preflight</p><p>· Origins</p><h3>Module 10 — OAuth2 &amp; OIDC</h3><p>Topics to master:</p><p>· OAuth2 flows</p><p>· Authorization Code</p><p>· PKCE</p><p>· OIDC</p><p>· Google Login</p><h3>Module 11 — Spring Authorization Server</h3><p>Topics to master:</p><p>· Access tokens</p><p>· Refresh tokens</p><p>· Client registration</p><p>· Scopes</p><p>· Consent</p><p>· Token introspection</p><h3>Module 12 — Advanced Topics</h3><p>Topics to master:</p><p>· Multiple AuthenticationProviders</p><p>· LDAP</p><p>· SAML overview</p><p>· Anonymous auth</p><p>· Switch User</p><p>· Authentication events</p><p>· Testing</p><p>· Production hardening</p><h3>Recommended Learning Order</h3><p>1. Authentication</p><p>2. SecurityContext</p><p>3. Authorization</p><p>4. Filters</p><p>5. JWT</p><p>6. Method Security</p><p>7. Session</p><p>8. Exception Handling</p><p>9. CSRF/CORS</p><p>10. OAuth2</p><p>11. Authorization Server</p><p>12. Advanced</p><h3>Interview Goal</h3><p>After completing this roadmap you should be able to explain the complete authentication lifecycle, authorization decisions, filter chain, JWT implementation, OAuth2 integration, and Spring Security architecture for senior Java interviews.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f66139b15d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Security introduction]]></title>
            <link>https://medium.com/@meabhishekforyou/spring-security-introduction-eb50b8a6a54e?source=rss-3a8733093950------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb50b8a6a54e</guid>
            <category><![CDATA[spring-security]]></category>
            <category><![CDATA[spring-security-basics]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[javasecuritybestpractices]]></category>
            <category><![CDATA[spring-security-6]]></category>
            <dc:creator><![CDATA[abhishek raj]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 05:49:57 GMT</pubDate>
            <atom:updated>2026-07-11T05:49:57.412Z</atom:updated>
            <content:encoded><![CDATA[<p>This document is intended as the first chapter of a Spring Security learning series. It explains what Spring Security is, why it is needed, the problems it solves, and the major features it provides.</p><h3>1. What is Spring Security?</h3><p>Spring Security is the official security framework for the Spring ecosystem. It provides a comprehensive authentication and authorization solution for Java applications. It integrates with Spring Boot and protects web applications, REST APIs and microservices against unauthorized access.</p><h3>2. Why Do We Need Spring Security?</h3><p>Without a security framework, developers must implement every security concern manually. This often leads to inconsistent implementations and security vulnerabilities.</p><p>· Authenticate users (verify identity).</p><p>· Authorize users (verify permissions).</p><p>· Protect REST APIs and web applications.</p><p>· Secure passwords using strong hashing algorithms.</p><p>· Prevent unauthorized access to sensitive resources.</p><p>· Integrate with OAuth2, JWT, LDAP, SAML and external identity providers.</p><p>· Provide protection against common web attacks.</p><h3>3. Common Security Problems</h3><p>· Unauthenticated users accessing protected APIs.</p><p>· Weak password storage.</p><p>· Session hijacking.</p><p>· Cross Site Request Forgery (CSRF).</p><p>· Cross Origin Resource Sharing (CORS) misconfiguration.</p><p>· Broken access control.</p><p>· Privilege escalation.</p><h3>4. Authentication vs Authorization</h3><p>Authentication answers ‘Who are you?’. Authorization answers ‘What are you allowed to do?’. Authentication always happens before authorization.</p><p>Aspect</p><p>Authentication</p><p>Authorization</p><p>Question</p><p>Who are you?</p><p>What can you access?</p><p>Input</p><p>Username/Password, JWT, OAuth2</p><p>Roles, Authorities, Permissions</p><p>Result</p><p>Authenticated user</p><p>Access Granted or Denied</p><h3>5. High-Level Spring Security Architecture</h3><p>Client<br> ↓<br> Tomcat<br> ↓<br> DelegatingFilterProxy<br> ↓<br> FilterChainProxy<br> ↓<br> SecurityFilterChain<br> ↓<br> Authentication Filters<br> ↓<br> AuthenticationManager<br> ↓<br> AuthenticationProvider<br> ↓<br> UserDetailsService<br> ↓<br> Database</p><h3>6. Major Features</h3><p>· Authentication (Form Login, HTTP Basic, JWT, OAuth2, LDAP).</p><p>· Authorization using roles and authorities.</p><p>· Method-level security using @PreAuthorize and @Secured.</p><p>· Password encoding using BCrypt, Argon2 and others.</p><p>· Session management and stateless JWT authentication.</p><p>· CSRF, CORS and security headers.</p><p>· Custom filters and exception handling.</p><p>· Testing support with Spring Security Test.</p><h3>7. Core Components</h3><p><strong>SecurityFilterChain: </strong>Defines how incoming requests are secured.</p><p><strong>AuthenticationManager: </strong>Entry point for authentication.</p><p><strong>AuthenticationProvider: </strong>Performs the actual authentication.</p><p><strong>UserDetailsService: </strong>Loads users from a data source.</p><p><strong>UserDetails: </strong>Represents the authenticated user.</p><p><strong>PasswordEncoder: </strong>Securely verifies passwords.</p><p><strong>SecurityContext: </strong>Stores the authenticated user.</p><p><strong>SecurityContextHolder: </strong>Provides access to the SecurityContext.</p><h3>8. Why Spring Security is Popular</h3><p>· Official Spring project with excellent Spring Boot integration.</p><p>· Highly extensible architecture.</p><p>· Suitable for monoliths, REST APIs and microservices.</p><p>· Industry-standard implementations instead of custom security code.</p><p>· Large community and long-term maintenance.</p><h3>9. What You Should Learn Next</h3><p>· Spring Security architecture</p><p>· Servlet Filters and SecurityFilterChain</p><p>· Authentication flow</p><p>· SecurityContext and SecurityContextHolder</p><p>· Authorization</p><p>· Session management</p><p>· JWT authentication</p><p>· OAuth2 and OpenID Connect</p><p>· Method security</p><p>· Production best practices</p><h3>10. Key Takeaways</h3><p>· Spring Security is a complete security framework, not just a login library.</p><p>· Authentication verifies identity; authorization verifies permissions.</p><p>· Spring Security is filter-based and intercepts requests before controllers.</p><p>· Most enterprise Java applications rely on Spring Security for authentication and authorization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb50b8a6a54e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collections framework in java part 1]]></title>
            <link>https://medium.com/@meabhishekforyou/collections-framework-in-java-part-1-6fd05984e344?source=rss-3a8733093950------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fd05984e344</guid>
            <category><![CDATA[collection-framework]]></category>
            <dc:creator><![CDATA[abhishek raj]]></dc:creator>
            <pubDate>Sun, 11 Jan 2026 07:11:12 GMT</pubDate>
            <atom:updated>2026-01-11T07:11:12.553Z</atom:updated>
            <content:encoded><![CDATA[<p>Before Java 1.2 → Arrays only. <br> Problems in arrays</p><ul><li>Fixed size</li><li>No ready-made algorithms</li><li>No thread safety</li><li>No searching, sorting, grouping</li></ul><p>Collections solve:<br> ✔ Dynamic size<br> ✔ Built-in algorithms<br> ✔ Thread safety<br> ✔ Performance optimized structures</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*Z9hUBtG9Ii6yoyqeF8bEFg.png" /><figcaption>collection hierarchy</figcaption></figure><p><strong>Iterable</strong> is the <em>root</em> of the entire Java Collections traversal mechanism, and interviewers often use it to check how deep you understand collections.It represents <strong>a collection of elements that can be iterated (looped) one by one</strong>.</p><p>Before Java 5, iteration was done manually using loops.</p><p>Java introduced Iterable to:</p><ul><li>Support <strong>for-each loop</strong></li><li>Provide a <strong>standard way to traverse collections</strong></li><li>Separate <strong>traversal logic from storage logic</strong></li></ul><pre>for(String s : list) {<br>    System.out.println(s);<br>}</pre><p>this works because List implements iterable.</p><p>Methods of Iterable interface</p><pre>public interface Iterable&lt;T&gt; {<br>    Iterator&lt;T&gt; iterator();<br>    default void forEach(Consumer&lt;? super T&gt; action);<br>    default Spliterator&lt;T&gt; spliterator();<br>}</pre><ol><li>Iterator&lt;T&gt; iterator() -&gt; Returns an <strong>Iterator</strong> object which is used to traverse elements. example shown below</li></ol><pre>List&lt;String&gt; list = List.of(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;);<br><br>Iterator&lt;String&gt; it = list.iterator();<br>while(it.hasNext()) {<br>    System.out.println(it.next());<br>}</pre><p>2. forEach ()</p><pre>default void forEach(Consumer&lt;? super T&gt; action)<br>Allows lambda-based traversal<br>list.forEach(e -&gt; System.out.println(e));</pre><p>3. spliterator() :</p><p>Splits data</p><p>Sends chunks to multiple threads</p><p>Improves performance in large collections</p><pre>Spliterator&lt;T&gt; spliterator();<br>Used for parallel processing in Streams<br>list.stream().parallel().forEach(System.out::println);</pre><p>❓ Why Iterable has only one abstract method?<br> ➡ To support lambda and for-each loop.</p><p>❓ How does for-each work internally?<br> ➡ Uses iterator() method.</p><p>❓ Why Map does not extend Iterable?<br> ➡ Because it stores pairs, not single elements.</p><p>❓ Difference between Iterator and Spliterator?<br> ➡ Iterator → single-thread<br> ➡ Spliterator → parallel stream support</p><p>❓ Can we modify collection while iterating?<br> ➡ Only using Iterator.remove(), otherwise ConcurrentModificationException</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fd05984e344" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Be aware of fake cyber police and fake CBI police]]></title>
            <link>https://medium.com/@meabhishekforyou/be-aware-of-fake-cyber-police-and-fake-cbi-police-1c7823988094?source=rss-3a8733093950------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c7823988094</guid>
            <category><![CDATA[fake-cbi]]></category>
            <category><![CDATA[online-fraud]]></category>
            <category><![CDATA[fake-cyber-police]]></category>
            <category><![CDATA[scam]]></category>
            <category><![CDATA[money-fraud]]></category>
            <dc:creator><![CDATA[abhishek raj]]></dc:creator>
            <pubDate>Wed, 01 May 2024 07:27:34 GMT</pubDate>
            <atom:updated>2024-05-01T07:27:34.701Z</atom:updated>
            <content:encoded><![CDATA[<p>Now a days a lot of people are being victim of cyber crime and fraud happening frequently. They have n no ways to deceive you. The only thing that will help you is your awareness of the scenario.</p><p>I want to share a recent experience of mine where I got a call from a delivery agent saying that there is courier sent from <strong>Mumbai </strong>to <strong>Thailand </strong>it contains some illegal items in it. since my name and phone number was used at the sender side he asked me to file a complaint on cyber police station and redirected the call to cyber police station.</p><p>Cyber police a<em>s</em>ked me to have a skype call and report the online FIR through skype call. Considering lack of time I did the skype complaint as per the details shared by the fake courier company employee. The company name was <strong>Sedex</strong>. They impersonated themselves as real CBI and real officer and did everything the way they proceed with the case. I shared few important details to them and also shared about my assets in my bank account considering it as official investigation. Once they will take every detail they will send you a letter about an agreement as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*Wb-WiA0KI1ShNn7CBFTakg.png" /></figure><p>The letter looks so real that anyone will be bemused and trust the cheters. I also trusted them. They set some rules that I don’t have to use mobile phone or internet and they are doing surveillance on me all the time through skype call. I agreed to their condition and cooperated with them. <br>They were talking to me at every two hours and explaining me about false investigation. They shared that your Aadhaar was used to create a false bank account and it was used to get ransom money in a kidnapping case. They told that you are not accused but suspect in this case. I was ready to cooperate with them on every ground. <br>Other day again in morning they asked few questions to me and then shared that my phone surveillance is completed and result is positive now it’s time to check my bank account and share another letter from RBI. <br>They will create everything so legal that anyone get confused.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*GIzGOV6-ifH0nwW9XyFqeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*N634UxIFKEv0drf08t3Lxg.png" /></figure><p>I read all the details and they asked me to transfer the amount to a bank account. I refused to do so and asked them if you are real CBI you must have the authority to look my account details and check all my details.</p><p>I cut the call telling you are a fraud and I am going to police . they continue to message me and threaten me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uG9KOuhA1G4dKM8KPhAnYQ.png" /></figure><p>This was the part of conversation happened between me and the cheaters. <br> As per me it’s very difficult to believe anyone on the call whether they are legitimate or fake. A lot of people get tricked and they loose all of their savings. Only way is to be aware and don’t entertain these calls or message or emails or links. These are the steps they follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*_bpmps-6XjWeO5WlXkpt7A.png" /></figure><p>When I started searching in depth I saw a lot of people have become the victim of this fraud and they could not get their money back.</p><p>See the similar case : <a href="https://www.linkedin.com/posts/tarun-bhalla-5009b842_beware-of-fake-fedex-and-fake-mumbai-police-activity-7041095932645380097-WC-p">https://www.linkedin.com/posts/tarun-bhalla-5009b842_beware-of-fake-fedex-and-fake-mumbai-police-activity-7041095932645380097-WC-p</a></p><p>My goal to write this post is to let others aware about scammers intention and keep their money and health safe.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c7823988094" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add Security to the Spring Boot Application. Part -1]]></title>
            <link>https://medium.com/@meabhishekforyou/add-security-to-the-spring-boot-application-part-1-efd1d2afb0d9?source=rss-3a8733093950------2</link>
            <guid isPermaLink="false">https://medium.com/p/efd1d2afb0d9</guid>
            <category><![CDATA[spring-security]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[abhishek raj]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 16:58:49 GMT</pubDate>
            <atom:updated>2024-03-21T16:58:49.662Z</atom:updated>
            <content:encoded><![CDATA[<p>Security is an indispensable aspect of our daily lives, permeating every facet, including the applications we interact with. Understanding its two core components, authentication and authorization, is crucial. Authentication verifies a user’s identity, while authorization determines their permissible actions.</p><p>There are two things that we need to be aware while implementing security.</p><ol><li>Authentication (confirming the identity of a user)</li><li>Authorization (determining what a user is allowed to do)</li></ol><p>In this article we are going to cover how to implement security to spring boot application that does not have security implemented. <br>First we need to add the dependency shown below to our pom.xml</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><p>the above dependency we need to add to our spring boot application to implement security. It will download all the necessary jars and libraries required to implement security.</p><p>Spring Boot provides sensible defaults for configuring Spring Security. When we add the Starter Security dependency, it automatically configures a set of basic security features for your application. This includes protecting endpoints, enabling form-based login, and requiring authentication for accessing resources.</p><p>When the application is not customized then spring security provides a default implementation for the security.</p><p>Spring Security provides mechanisms for authentication and authorization . With Spring Boot Starter Security, you can easily configure authentication mechanisms such as form-based login, HTTP Basic authentication, OAuth, etc. You can also define access control rules to restrict access to certain parts of your application based on user roles or permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TzQQPrwsBski1Qs0_ui8vQ.png" /></figure><p>after generating the project using spring initializr first we need to extract it and run the application. We can see some auto-generated password on console as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7OYWchIDnpzR3vJ4dkm1A.png" /><figcaption>screeshot of application console</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YryyzMxar_ej-nZ3nwRO9Q.png" /></figure><p>Now go to browser and hit localhost:8080 you will see a login page like shown below.</p><p>Just enter user as username and the generated password as password and then it will allow you to enter to the application. <br>Since we have not configured anything after adding dependency to the application so spring boot provide default implementation of it . We have the choice to configure everything in spring boot as per our need . <br>Here we can see the password was generated automatically by spring boot <br>suppose we don’t want to use that password and default username instead we want to configure our own username and password . we can use this code changes in application.properties file .</p><pre>spring.security.user.name=abhishek<br>spring.security.user.password=password@1209</pre><p>Once the changes are made just restart the application and use the above configured credentials on the web page. You will observe that this time when application is run there won’t be any auto-generated password in console and using the configured credentials we can enter to the application. Similarly there are lot of things that we can configure in our application. I will cover those in next articles. Thanks for reading .please subscribe to get update on further articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efd1d2afb0d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>