<?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 Martin Czerwinski on Medium]]></title>
        <description><![CDATA[Stories by Martin Czerwinski on Medium]]></description>
        <link>https://medium.com/@martinczerwinski?source=rss-a7dabf20e5b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IgjCEiTbU95cVH3m.</url>
            <title>Stories by Martin Czerwinski on Medium</title>
            <link>https://medium.com/@martinczerwinski?source=rss-a7dabf20e5b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:58:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@martinczerwinski/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[Intro to Spring Security]]></title>
            <link>https://medium.com/@martinczerwinski/intro-to-spring-security-1955aa8356b8?source=rss-a7dabf20e5b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1955aa8356b8</guid>
            <dc:creator><![CDATA[Martin Czerwinski]]></dc:creator>
            <pubDate>Tue, 03 Apr 2018 21:49:41 GMT</pubDate>
            <atom:updated>2018-04-12T23:33:54.752Z</atom:updated>
            <content:encoded><![CDATA[<p>Spring Security is a sub-project of the vast Spring Framework portfolio. Spring Security is optimized to be used with a Spring MVC web application framework but can also be used with Java servlets. Spring Security supports authentication integration with a long list of other technologies, such as, Lightweight Directory Access Protocol (LDAP), Java Authentication and Authorization Service, and OpenID. It was developed to be a comprehensive security solution for Java-based Enterprise Environments.</p><p>Spring Security was started in 2003 by Ben Alex and was called the Acegi Security System for Spring. It was re-branded and released officially as Spring Security in 2007. It has since secured its reputation as a reliable security solution and is widely used today.</p><h4>Spring Security Architecture</h4><p>Spring Security sets out to solve the problems of authentication (controlling access to the site) and authorization (controlling user access to different site features). In general, web application security is defined by these two major categories. It is important to note that authorization is also often referred to as ‘access control’ due to the ambiguity of the term.</p><p>The following will describe the hierarchical architecture of classes that Spring Security uses to address the issue of authentication. First, Spring Security has an <em>AuthenticationManager </em>interface which contains a single method, <em>authenticate(). </em>This is most commonly implemented using the <em>AuthenticationProvider </em>interface, which also provides a method for determining if the implementation will support the type of <em>Authentication </em>class to be passed to its <em>authenticate() </em>method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*uKNR_LHcYQIKsoTaqbHlWA.png" /><figcaption>Code snippet from official Spring Guide: <a href="https://spring.io/guides/topicals/spring-security-architecture/">https://spring.io/guides/topicals/spring-security-architecture/</a></figcaption></figure><p>Overall, authentication is then managed by a <em>ProviderManager </em>which maintains a list of <em>AuthenticationProvider(s) </em>to verify any authentication requests. The <em>authenticate() </em>method can be implemented by connecting to a JDBC database or other data source.</p><p>To manage authorization (access control) Spring has an <em>AccessDecisionManager </em>class. Similar to how the <em>ProviderManager </em>has a list of <em>AuthenticationProvider(s)</em>, the <em>AccessDecisionManager </em>delegates to a chain of <em>AccessDecisionVoter(s). </em>This means that there can be multiple factors to a users authorization which would be represented as multiple <em>AccessDecisionVoter(s). </em>There are various implementations of this class already provided through the Spring framework, but the programmer is also able to create custom implementations.</p><p>The way authorization is structured is that it is dependent on an authentication object called a <em>Principal. </em>This <em>Principal</em> object is created during authentication and is located in the <em>SecurityContextHolder</em>. The following code can be executed anywhere in your web application to obtain information about the current Authentication object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*aRlUIPuQ6xJOxl3sEU7Dzg.png" /></figure><p>This is an efficient and clean way to manage the authorized user.</p><p>The <em>AccessDecisionVoter</em> uses this authentication object to verify if the user can interact with any secure <em>Object</em>. A secure <em>Object</em> is an object in Spring that has (or supports) a <em>ConfigAttribute </em>attribute. Such an object would look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*_k9LoZNp5ntJBCHhFuVh4g.png" /><figcaption>Code snippet from official Spring Guide: <a href="https://spring.io/guides/topicals/spring-security-architecture/">https://spring.io/guides/topicals/spring-security-architecture/</a></figcaption></figure><p>In Spring Security the <em>Principal </em>object is most often an instance of <em>UserDetails</em>. <em>UserDetails</em> is a fairly self-explanatory object used to describe an applications user. The user Spring creates can be used to authenticate different layers of the application, such as the database access. It is possible to create a custom <em>UserDetailsService</em> if the programmer desires. Users are typically used to authenticate access to other applications such as LDAP, or many other databases. LDAP is not actually a database, so I will describe it in further detail in the next section.</p><h4>Lightweight Directory Access Protocol (<strong>LDAP</strong>)</h4><p>A directory is a list of information that is distributed over an Internet Protocol network. This information could be a list of users, system information, or other information about system services. This information can be accessed by many different applications that access an LDAP server. LDAP is the industry standard application protocol and is typically used to store users’ names and passwords.</p><p>In conclusion, I hope this has outlined what the basics of Spring Security looks like and what it can be used for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1955aa8356b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide to Spring @Autowired Annotation]]></title>
            <link>https://medium.com/@martinczerwinski/guide-to-spring-autowired-annotation-1539eaae19c9?source=rss-a7dabf20e5b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1539eaae19c9</guid>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Martin Czerwinski]]></dc:creator>
            <pubDate>Mon, 26 Mar 2018 05:48:40 GMT</pubDate>
            <atom:updated>2018-03-26T11:34:27.277Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide will give an introduction to how the Spring Framework uses @Autowired annotations as a method of Dependency Injection. Dependency Injection can also be accomplished in Spring using XML configuration, but the autowiring method reduces the amount of configuration code that needs to be written. If a dependency is specified in the XML it will take precedence over autowired configurations.</p><p>How Autowiring works is that it injects the required dependencies to Spring beans by simply labeling the dependencies as Autowired. Spring autowiring automatically determines a service’s ID by considering the name of the class and variables. This method of labeling is called type-hints. Therefore, it is important to keep your naming and capitalization standards organized. The examples in this blog will show the relationships between the autowire annotation names and the class names.</p><p>Autowiring anotation can be implemented in three different ways: Constructor-based, Setter-based, or Property-based.</p><h4>Constructor-based</h4><p>When the class <em>ExampleService </em>is created, the dependency <em>ExampleWriter</em> is instantiated and injected into the constructor as an argument.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*T3jxR6zeFrjpoDq8HwcYQg.png" /><figcaption>Constructor-based Autowiring</figcaption></figure><h4>Setter-based</h4><p>This is very similar to the Constructor-based autowiring method. The difference is simply that a setter method is being called instead of the objects constructor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*SlCt4IXlNqmWbHivdaj7Yw.png" /><figcaption>Setter-based Autowiring</figcaption></figure><h4>Property-based</h4><p>In this example, Spring looks for <em>exampleWriter </em>and injects it when <em>ExampleService</em> is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*t911Ea26pUNBogK3JhzIQw.png" /><figcaption>Property-based Autowiring</figcaption></figure><p>This shows how Spring automatically determines that the component ID which corresponds to the autowired variable name is the component required as a dependency.</p><p>It is important to note that Autowiring must be set-up and enabled in order to work. In a java-based project, Spring requires that it is launched through an <em>AnnotationConfigApplicationContext class </em>instead of a regular <em>ApplicationContext</em> class to enable autowiring. In Spring XML, the tag <em>&lt;context:annotation-config&gt; is used.</em></p><p>In conclusion, autowiring is great because it is easy to implement and does a lot of the work for you. As well, it ensures Spring beans remain decoupled.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1539eaae19c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to Spring Framework]]></title>
            <link>https://medium.com/@martinczerwinski/an-introduction-to-spring-framework-1784958fdba9?source=rss-a7dabf20e5b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1784958fdba9</guid>
            <category><![CDATA[dependency-inversion]]></category>
            <category><![CDATA[inversion-of-control]]></category>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Martin Czerwinski]]></dc:creator>
            <pubDate>Mon, 29 Jan 2018 06:50:38 GMT</pubDate>
            <atom:updated>2018-01-29T06:57:12.001Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vfimYsuf9DdHofYqzBtwzA.png" /></figure><p>Spring has been one of the most popular Java Frameworks since its official release in 2003 and is an open-source project. Since it has been around so long it is integrated with many dependencies, such as various NoSQL databases and RESTful Web Services. It also has a large repository of its own tools, like Spring Security, Spring MVC, and integration with Facebook. Its main feature is that it’s designed to use dependency injection — one of the ‘best practices’ of coding.</p><p>Spring Framework is a very extensive framework and can be used to solve a range of problems across the full stack. To get an idea of this range here is a list of the main features of Spring:</p><p>· Inversion of Control (Dependency Injection)</p><p>· Aspect Oriented Programing</p><p>· Data Access Support</p><p>· Transaction Management</p><p>· Web Services</p><p>· Social Media Integration</p><p>· I/O (such as javax.mail)</p><p>· Cloud Services</p><p>In this introduction I will explain the concept of dependency injection and how Spring Framework functions.</p><h4>Dependency Injection</h4><p>Understanding dependency injection is key to understanding why Spring is so popular. The reason dependency injection is used is to eliminate the scenario where an object is dependent on the creation of another object. When a class instantiates another object, it is dependent on that object. This can be problematic if the instantiated object is modified in some way because it then requires any class that uses it to be modified. Basically, dependency injection eliminates this by creating all the dependencies when creating an object. Spring Framework accomplishes this by creating an interface that is implemented by an object, and using the method of this interface.</p><p>Spring represent your objects using spring beans. These are either configured in XML or in notations.</p><h4>Spring Set-up</h4><p>Spring is functionally a bunch jars that can read XML or use annotations, since their are so many jars and the versions of the jars have to be compatible its common to use a project management program like Maven. Spring is setup to use project management services like Maven or Gradle which automatically downloads the jars that you need. This is done through an XML page that manages a projects’ dependencies and other configurations, called a Project Object Model (POM) file.</p><p>A Spring program uses various dependencies which can be downloaded via the <a href="https://start.spring.io/#">Spring Initializr</a>.</p><p>The best IDE’s to use with Spring are Eclipse or IntelliJ. Eclipse has Spring plug-ins or you can just download Spring Tool Suite which is basically Eclipse with all the plug-ins pre-installed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1784958fdba9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>