<?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 Sercan A. on Medium]]></title>
        <description><![CDATA[Stories by Sercan A. on Medium]]></description>
        <link>https://medium.com/@goldenarchitech?source=rss-816b14ff1abc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nS1xc7Ua7cfDHnCA10qelg.png</url>
            <title>Stories by Sercan A. on Medium</title>
            <link>https://medium.com/@goldenarchitech?source=rss-816b14ff1abc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:01:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@goldenarchitech/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[Containerizing Keycloak with PostgreSQL using Docker: A Step-by-Step Guide]]></title>
            <link>https://goldenarchitech.medium.com/containerizing-keycloak-with-postgresql-using-docker-a-step-by-step-guide-ba256cb7f9f?source=rss-816b14ff1abc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba256cb7f9f</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[keycloak]]></category>
            <dc:creator><![CDATA[Sercan A.]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 15:05:54 GMT</pubDate>
            <atom:updated>2023-03-26T15:05:54.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wD3iIUJbXlljESR7.png" /></figure><p>Keycloak is an open source identity and access management solution. It enables users to perform authentication and authorization processes, and helps application developers manage user access in their applications.</p><p>Keycloak provides identity verification and authorization management for multiple applications through a single central management panel. This allows users to access multiple applications with a single set of login credentials. Additionally, Keycloak can integrate with other identity verification and authorization sources such as social media accounts, LDAP or Active Directory.</p><p>Keycloak is compatible with popular web application frameworks such as Java EE and Spring Framework, and can be used in various environments such as Docker. In this article, we will show how to configure and activate Keycloak using Docker and the PostgreSQL database.</p><h3>Preparation of Container Image</h3><p>This section assumes that the Docker platform and Docker Desktop application are installed on your operating system. If not, you can follow the installation steps specified in <a href="#">the Docker official documentation</a> to get the platform ready to work. First, you need to create the CustomKeycloak.dockerfile.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/141e4a076588d0c050128f2927cc41bb/href">https://medium.com/media/141e4a076588d0c050128f2927cc41bb/href</a></iframe><p>The descriptions of the commands in the file are as follows;</p><ul><li><strong>FROM</strong>: In this line, the base image to be used is specified. This Dockerfile pulls the Keycloak image with version number 21.0.0 from the quay.io/keycloak/keycloak repository and uses it to create a new image.</li><li><strong>LABEL</strong>: These lines are used to add metadata to the Docker image. The version label specifies the version number of the image, while the description label defines the description of the image.</li><li><strong>WORKDIR</strong>: This line sets the default working directory inside the image after the Docker image is built. In this case, the /opt/keycloak directory is specified.</li><li><strong>RUN</strong>: This line is used to execute the commands used in the Dockerfile. In this case, the /opt/keycloak/bin/kc.sh build command is executed. This command compiles the necessary files to create the Keycloak image.</li><li><strong>ENTRYPOINT</strong>: This line specifies the default command to be executed when the Docker image is started. In this case, the /opt/keycloak/bin/kc.sh command is specified. This command is used to start the Keycloak server</li></ul><p>After creating the Dockerfile, run the following command in the terminal to build your customized Keycloak image.</p><pre>docker build -t custom-keycloak-image -f .\CustomKeycloak.dockerfile .</pre><p>After running the command, you can view the created image under the Images tab in the Docker Desktop application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*raDuepDo0pGMMElMLCuUtQ.png" /></figure><p>or confirm that the image has been properly created by running the following code in your terminal.</p><pre>docker images</pre><p>This command displays the list of all images available on the system. If your customized Keycloak image has been successfully created, you should see it listed among the other images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*_nfKJ4uzZnV5uQOglmdEQQ.png" /></figure><h3><strong>Configuring Services with Docker-Compose</strong></h3><p>In this section, we will configure services using docker-compose, which allows you to deploy software applications and manage and orchestrate multiple Docker containers with a single command, using a YAML file. Below are some example docker-compose.yml configurations.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0fbd3b89081d8d3fa8bb81eb8b7481f/href">https://medium.com/media/c0fbd3b89081d8d3fa8bb81eb8b7481f/href</a></iframe><p>The description of the fields used for the services defined under the <strong>Services</strong> section is as follows;</p><h3>PostgreSQL Configurations</h3><ul><li><strong>postgres</strong>: This service creates a PostgreSQL database server.</li><li><strong>image</strong>: Specifies the base image of the container. In this case, the image <strong>postgres:14.7</strong> will be used.</li><li><strong>environment</strong>: This is the area where the environment variables to be used when the container runs are defined. In this case, the environment variables <strong>POSTGRES_USER</strong> and <strong>POSTGRES_PASSWORD</strong> are defined as the admin credentials for the database.</li><li><strong>ports</strong>: Specifies the ports to which the service will connect. In this case, the connection will be established using the <strong>external service port 5100</strong> and the <strong>internal service port 5432</strong>.</li><li><strong>volumes</strong>: This is the area where the volumes to be used in the container are defined. In this case, a volume named <strong>postgres</strong> will be connected to the <strong>/var/lib/postgresql/data</strong> directory.</li></ul><h3>Keycloak Configurations</h3><ul><li><strong>keycloak</strong>: This service is a Keycloak container managed by Docker Compose.</li><li><strong>build</strong>: This option indicates that the Docker image in the directory where the Dockerfile is located will be created.</li><li><strong>image</strong>: This option specifies the name of the created Docker image. Here, the name is set as <strong>custom-keycloak-image</strong> that is modified with dockerfile.</li><li><strong>environment</strong>: This option is used to set environmental variables inside the container. Various variables are set for Keycloak here.</li><li><strong>depends_on</strong>: This option specifies that other services specified must be started first for this service to start. Here, the database service named <strong>postgres</strong> is specified.</li><li><strong>ports</strong>: This option determines which ports of the container will be open to the outside world. Here, port <strong>8080</strong> is opened to the outside world.</li><li><strong>command</strong>: This option specifies the command that will run when the container is started. Here, the “start” command is specified.</li></ul><h3>Common Configurations of Services</h3><ul><li><strong>container_name</strong>: Specifies the name of the container to be created.</li><li><strong>restart</strong>: Used when the container needs to be automatically restarted. In this case, <strong>“unless-stopped”</strong> is used to ensure that the container is automatically restarted unless stopped manually.</li><li><strong>networks</strong>: Determines which network the container will be part of. In this case, it will be part of a custom network named <strong>custom-keycloak</strong>.</li></ul><h3>Docker Configurations</h3><ul><li><strong>version</strong>: Specifies the version of the Docker Compose file. In this file, version 3.9 is used.</li><li><strong>services</strong>: Lists the services managed by Docker Compose.</li><li><strong>volumes</strong>: Specifies the volumes defined to be shared between containers. In this case, a volume named “postgres” is defined and will be created using the local driver.</li><li><strong>networks</strong>: Defines Docker networks. In this file, a custom network named “custom-keycloak” is defined and will be created using the bridge driver.</li></ul><blockquote><em>Note: These sections are aligned with the “services” section in the yml file.</em></blockquote><p>To run the edited docker-compose.yml file, you can use the following command:</p><pre>docker-compose up</pre><p>After the run command, first PostgreSQL database will become active and then your Custom Keycloak image will be activated. However, manual creation of database and schema definitions will be required on your PostgreSQL database. If these definitions are not created, your custom Keycloak image will not be activated. When the containers are up and running, they should look like the example image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*18GWukxtHHtUxH3G3V3fyw.png" /></figure><p>After the containers are ready, you can access the Keycloak admin panel using the link below and sign-in with the admin user you specified in the docker-compose configuration by clicking on the section marked in red.</p><pre>http://localhost:8080/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5JNb7jkw67PeotZyS0aug.png" /></figure><p>In conclusion, containerizing Keycloak with PostgreSQL using Docker provides an efficient and scalable solution for managing authentication and authorization in modern web applications. By leveraging the power of containerization and the flexibility of Docker, developers can easily deploy and manage their Keycloak instances with minimal effort and maximum reliability.</p><p>Stay Safe and Best Regards !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba256cb7f9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Theory behind SMS & Email OTP Validation]]></title>
            <link>https://goldenarchitech.medium.com/theory-behind-sms-email-otp-validation-ea28fee2f54c?source=rss-816b14ff1abc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea28fee2f54c</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[security-services]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[identity-management]]></category>
            <dc:creator><![CDATA[Sercan A.]]></dc:creator>
            <pubDate>Sun, 19 Feb 2023 08:52:14 GMT</pubDate>
            <atom:updated>2023-02-19T08:52:14.674Z</atom:updated>
            <content:encoded><![CDATA[<p>One-time passwords (OTPs) are a popular method for adding an additional layer of security to secure access, transaction authorization, and other purposes. Two popular methods of delivering OTPs are via SMS and email. In this article, we will discuss the theory behind how SMS and email OTPs work and compare the advantages and disadvantages of these methods.</p><p><strong>SMS OTP:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*DPf2_38PqhEHFoz_Ea6x5A.png" /></figure><p>When a user requests an SMS OTP, identity provider service generates a random code and sends it as an SMS via SMS service provider to the user’s phone number. The user then enters the code into the validation form, which is sent to identity provider for verification. Identity provider compares the code entered by the user to the code generated by the system and returns a success or failure message.</p><p><em>Advantages:</em></p><ol><li>Easy and convenient to use: SMS OTPs are widely supported, easy to use, and don’t require an internet connection. This makes them a practical option for users in areas with limited internet connectivity or where smartphones are not widely used.</li><li>Reliable: SMS messages are delivered almost instantly, making SMS OTPs very reliable. The delivery time of SMS is relatively stable, and it does not depend on internet connectivity or server status. This means that SMS OTPs are not affected by downtime, maintenance, or congestion on the internet or servers.</li></ol><p><em>Disadvantages:</em></p><ol><li>Costly: SMS OTPs can be costly, as each SMS sent for verification is charged by service providers. This can make SMS OTPs a more expensive option than email OTPs for high-volume use cases.</li><li>Security risks associated with phone number verification: SMS OTPs rely on phone number verification, which can be vulnerable to security risks such as SIM swapping. This means that SMS OTPs may not be the most secure option for high-risk applications.</li><li>Limited message length: SMS messages have a maximum length of 160 characters, which can limit the amount of information that can be conveyed in an SMS OTP.</li></ol><p><strong>Email OTP:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*NlOvjFoRurhaMv89U9y0ww.png" /></figure><p>When a user requests an email OTP, identity provider service sends a message to the user’s email address with a unique code. The user then enters the code into the validation form, which is sent to the identity provider for verification. The identity provider compares the code entered by the user to the code generated by the system and returns a success or failure message.</p><p><em>Advantages:</em></p><ol><li>More cost-effective solution: Email OTPs are generally more cost-effective than SMS OTPs, as there is no charge per message. This makes email OTPs a more practical option for high-volume use cases.</li><li>Widely supported: Emails are a widely supported technology, which means that Email OTPs can be received on any device with an internet connection, making them more accessible than SMS OTPs.</li><li>Easier to use for users with limited access to a phone or internet connection: Email OTPs can be accessed on any device with an internet connection, making them a practical option for users with limited access to a phone or internet connection.</li></ol><p><em>Disadvantages:</em></p><ol><li>Security risks associated with email accounts: Emails can be intercepted or redirected, email accounts can be compromised through phishing or malware attacks. This means that Email OTPs may not be the most secure option for high-risk applications.</li><li>Delivery time: Email delivery times can vary widely depending on the email provider, network status, and email settings. This means that Email OTPs may not be as reliable as SMS OTPs, especially if the user is in an area with poor internet connectivity.</li><li>Spam and junk filters: Emails can be filtered as spam or junk, which can cause Email OTPs to be missed or delayed. This can be frustrating for users who are waiting for an OTP to complete an important transaction or access a service</li></ol><p>In conclusion, SMS and email OTPs are two widely used methods for secure access and transaction authorization. SMS OTPs are easy to use, reliable, and don’t require an internet connection, making them a practical option for users in areas with limited internet connectivity or where smartphones are not widely used. However, SMS OTPs can be costly, and phone number verification can be vulnerable to security risks.</p><p>On the other hand, email OTPs are a more cost-effective solution and can be accessed on any device with an internet connection, making them more accessible than SMS OTPs. However, email accounts can be compromised through phishing or malware attacks, and delivery times can vary widely depending on the email provider, network status, and email settings.</p><p>Ultimately, the choice between SMS and email OTPs depends on the specific use case and the level of security required. While SMS OTPs may be more convenient and reliable, they may not be the most secure option for high-risk applications. Similarly, while email OTPs may be more cost-effective and accessible, they may not be the most secure option for applications that require a high level of security. Therefore, it is important to carefully consider the advantages and disadvantages of each method before selecting the appropriate method for a specific use case.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea28fee2f54c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>