<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cress</title>
    <description>The latest articles on DEV Community by Cress (@cress).</description>
    <link>https://dev.to/cress</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1085945%2F699b984a-2455-48ba-a068-85b5b11a00dd.jpg</url>
      <title>DEV Community: Cress</title>
      <link>https://dev.to/cress</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cress"/>
    <language>en</language>
    <item>
      <title>[FREE] How to Become a Cybersecurity Expert</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 28 Nov 2026 01:08:23 +0000</pubDate>
      <link>https://dev.to/cress/free-how-to-become-a-cybersecurity-expert-cb4</link>
      <guid>https://dev.to/cress/free-how-to-become-a-cybersecurity-expert-cb4</guid>
      <description>&lt;p&gt;Anyone can do it, and you're guaranteed to make money. An annual salary of 10 million yen is not just a dream. There really is such a dream job.&lt;/p&gt;

&lt;p&gt;It's called being a cybersecurity expert.&lt;/p&gt;

&lt;p&gt;Cyberattacks have become a major societal issue, making cybersecurity an urgent priority for society as a whole. Meanwhile, Japan is estimated to face a shortage of approximately 110,000 cybersecurity professionals, with more than 80% of companies identifying a lack of skilled personnel as a challenge.&lt;/p&gt;

&lt;p&gt;Here are just three simple steps to becoming a cybersecurity expert.&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 1: Start by Using Linux
&lt;/h2&gt;

&lt;p&gt;First and foremost, start using Linux.&lt;/p&gt;

&lt;p&gt;Install Linux on an old PC you no longer use and try running something like Apache HTTP Server. Ubuntu is an easy way to get started.&lt;/p&gt;

&lt;p&gt;But don't stop once you've got it running. Change the configuration, examine the logs, and try improving performance. When something stops working, investigate the cause and fix it.&lt;/p&gt;

&lt;p&gt;Repeat this process over and over again.&lt;/p&gt;

&lt;p&gt;Gradually, you will develop an intuitive understanding of how hardware, operating systems, and networks work. Linux is a particularly effective learning tool for understanding these fundamentals.&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 2: Understand How Things Work, Not Just How to Use Products
&lt;/h2&gt;

&lt;p&gt;There are countless software products in the world, but you don't need to learn how to use every single one of them.&lt;/p&gt;

&lt;p&gt;For example, both WebSphere and WebLogic are implementations of Java EE. Both JobCenter and JP1 are job management products. Switching from Struts to Spring MVC does not change the fundamental principles of how web applications work.&lt;/p&gt;

&lt;p&gt;Of course, product-specific features and configuration methods differ. However, if you understand the underlying mechanisms, you will have a good idea of what to investigate, even when working with an unfamiliar product.&lt;/p&gt;

&lt;p&gt;Keep building this kind of understanding until you can recognize familiar principles behind unfamiliar technologies.&lt;/p&gt;

&lt;p&gt;"I don't know because it's an IBM product."&lt;/p&gt;

&lt;p&gt;"I don't know because it's an Oracle product."&lt;/p&gt;

&lt;p&gt;"I don't know because the documentation is only available in English."&lt;/p&gt;

&lt;p&gt;There's no point in making excuses like these. If you don't know something, look it up.&lt;/p&gt;

&lt;p&gt;What matters is not how many products you are familiar with. What matters is your ability to understand how unfamiliar products work and learn to use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  STEP 3: Speak Up as a Professional
&lt;/h2&gt;

&lt;p&gt;Once you have acquired technical skills and developed an understanding of how systems work, the next thing you need is professional engineering ethics.&lt;/p&gt;

&lt;p&gt;When developing systems, you may encounter requirements that are technically feasible but should never be implemented.&lt;/p&gt;

&lt;p&gt;Suppose, for example, that you are presented with a requirement that could lead to the disclosure of personal information. Simply implementing what you have been asked to build is not enough. You must explain what the problem is and, if necessary, insist that the requirement itself be revised.&lt;/p&gt;

&lt;p&gt;The purpose is not to defy your manager or your client. Rather, it is a responsibility you must fulfill precisely because, as a professional, you understand the problem.&lt;/p&gt;

&lt;p&gt;Nor is it enough to simply do what you are told. When a major cyberattack occurs, ask yourself whether your own systems are secure and whether the same issue could affect them. If countermeasures are necessary, take the initiative to propose them.&lt;/p&gt;

&lt;p&gt;"We need these security measures, but implementing them will cost this much."&lt;/p&gt;

&lt;p&gt;That is perfectly fine. Costs, priorities, and coordination with other departments are issues for the organization to resolve. At the very least, you must not leave a known problem unaddressed simply because nobody told you to deal with it.&lt;/p&gt;

&lt;p&gt;Of course, being a professional does not give you the authority to make unilateral changes to a system. It is important to present sound technical justification, follow the appropriate procedures, and ensure that the necessary measures are implemented.&lt;/p&gt;

&lt;p&gt;Simply following instructions accurately does not make you a professional.&lt;/p&gt;

&lt;p&gt;Learn to speak up when something needs to be said and propose action when something needs to be done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;We live in an era in which frequent cyberattacks have a significant impact on business operations and everyday life. Cybersecurity has already become a challenge that can no longer be addressed by a limited number of specialists alone.&lt;/p&gt;

&lt;p&gt;That is why I hope to see more people become cybersecurity professionals.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>career</category>
      <category>careerdevelopment</category>
      <category>security</category>
    </item>
    <item>
      <title>I'm going to buy an Oracle license when this war is over.</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Tue, 29 Jul 2025 15:34:40 +0000</pubDate>
      <link>https://dev.to/cress/im-going-to-buy-an-oracle-license-when-this-war-is-over-5c5h</link>
      <guid>https://dev.to/cress/im-going-to-buy-an-oracle-license-when-this-war-is-over-5c5h</guid>
      <description>&lt;p&gt;I tried to buy an Oracle license but couldn't. Because the system we are developing has users in Russia office.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.oracle.com/jp/corporate/security-practices/corporate/governance/global-trade-compliance.html" rel="noopener noreferrer"&gt;https://www.oracle.com/jp/corporate/security-practices/corporate/governance/global-trade-compliance.html&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Any company or national of Cuba, Iran, North Korea, Syria, and the Crimea region, Ukraine's Donbas and other Russian controlled areas of Ukraine as they exist in fact, Belarus*, Russia* and Venezuela*. Export licensing of commodities or services intended for these countries is presumed denied;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is not only Oracle but also the other products from the United States.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That means we can't cut over our system unless Russia stops their war.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will be forced to make difficult decision, such as making our system not to be used Russia users, or quitting our all projects.&lt;/p&gt;

&lt;p&gt;A few fools are giving us a lot of trouble.&lt;/p&gt;

&lt;p&gt;What's wrong with being against the war?&lt;/p&gt;

</description>
      <category>oracle</category>
    </item>
    <item>
      <title>What I have become able to do by studying English</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Wed, 14 Aug 2024 12:25:33 +0000</pubDate>
      <link>https://dev.to/cress/what-i-had-become-able-to-do-by-studying-english-11kc</link>
      <guid>https://dev.to/cress/what-i-had-become-able-to-do-by-studying-english-11kc</guid>
      <description>&lt;p&gt;I had studied English at foreign insurance company for 1 year since April 2023. My colleagues at that time came from various countries, such as China, France, and India.&lt;/p&gt;

&lt;p&gt;What I have become able to do are following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request for restarting application servers&lt;/li&gt;
&lt;li&gt;Request for retrieving a log file and putting it into the shared file server&lt;/li&gt;
&lt;li&gt;Writing email for my resignation announcement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, I have become a banker since April 2024. I have communicated with EMEA, Americas, and APAC in English.&lt;/p&gt;

&lt;p&gt;What I have become able to do additionally are following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request for filling out for a network usage application&lt;/li&gt;
&lt;li&gt;Response for inquiries regarding system usage from foreign offices&lt;/li&gt;
&lt;li&gt;Apology for delay in sharing project overview&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I still can't have daily conversations.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Announcement</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 29 Jun 2024 05:16:38 +0000</pubDate>
      <link>https://dev.to/cress/announcement-1ibe</link>
      <guid>https://dev.to/cress/announcement-1ibe</guid>
      <description>&lt;p&gt;I graduate from my business for June on the last business day of June. I would like to appreciate for my supporters and apologize for my unsatisfactory results.&lt;/p&gt;

&lt;p&gt;It was only a short period of 20 business days since I started business on 3rd June and terminated on 28th. Although I have learned the business for June and have many opportunities in the future, I am also very disappointed that the last business day has come.&lt;/p&gt;

&lt;p&gt;By the way, July comes soon. I will do my best using my experience of June.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Graduation from senior engineer</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Thu, 07 Mar 2024 16:10:38 +0000</pubDate>
      <link>https://dev.to/cress/graduation-from-senior-engineer-84o</link>
      <guid>https://dev.to/cress/graduation-from-senior-engineer-84o</guid>
      <description>&lt;p&gt;I will graduate from senior engineer at the end of this month.&lt;br&gt;
From next month, I will become a banker at a Japanese famous mega bank.&lt;/p&gt;

&lt;p&gt;My technical field was open technologies such as Java, Oracle, and Linux. I have been involved in IT system development for life insurance business for 14 years. I could gain experiences of IT and finance.&lt;/p&gt;

&lt;p&gt;Additionally, I have studied English very hard since last year. Because I could not talk about business with my colleagues without English. My business was widen because of English, and I could know that there are many more talented engineers in the world.&lt;/p&gt;

&lt;p&gt;Now I will be involved in international information systems for the mega bank. Although I will become not to make programs by myself, I will improve information systems by different approach.&lt;/p&gt;

&lt;p&gt;I will graduate from senior engineer soon.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>My purpose of studying foreign languages</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Mon, 21 Aug 2023 06:43:43 +0000</pubDate>
      <link>https://dev.to/cress/my-purpose-of-studying-foreign-languages-3j3p</link>
      <guid>https://dev.to/cress/my-purpose-of-studying-foreign-languages-3j3p</guid>
      <description>&lt;p&gt;One of my colleagues is a young engineer from France. He is so talented that he will become an executive. When he becomes an executive, he should take us to an exclusive Japanese restaurant. For that day, I must study French as well as English.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Create a web application for a small business by Next.js with Slack authentication</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 27 May 2023 11:56:54 +0000</pubDate>
      <link>https://dev.to/cress/create-a-web-application-for-a-small-business-by-nextjs-with-slack-authentication-23l3</link>
      <guid>https://dev.to/cress/create-a-web-application-for-a-small-business-by-nextjs-with-slack-authentication-23l3</guid>
      <description>&lt;p&gt;Creating a web application, it is hard work that implementing a login authentication. Login authentication, reissuance forgotten password, password change and etc. are required. But using NextAuth.js and Slack, you don't need for preparing these yourself. It is very easy and recommended for small businesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create LOCAL server with HTTPS enabled
&lt;/h2&gt;

&lt;p&gt;Slack requires that the application URL uses HTTPS, even for local development. In this case, local-ssl-proxy is easy and useful.&lt;/p&gt;

&lt;p&gt;See also:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6"&gt;https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure on Slack side
&lt;/h2&gt;

&lt;p&gt;Follow quickstart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://api.slack.com/authentication/quickstart" rel="noopener noreferrer"&gt;https://api.slack.com/authentication/quickstart&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a client ID and a client secret
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click "Create a new Slack app" button.&lt;/li&gt;
&lt;li&gt;In "Your Apps" page, click "Create New App" and choose "From scratch"&lt;/li&gt;
&lt;li&gt;Enter your app name and pick a workspace to develop your app in.&lt;/li&gt;
&lt;li&gt;Click "Create App" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then, in "App Credentials" section of "Basic Information" page, you can see its client ID and client secret.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure a redirect URL
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In "Add features and functionality" section of "Basic Information" page, click "Permissions".&lt;/li&gt;
&lt;li&gt;In Redirect URLs of "OAuth &amp;amp; Permissions" page, click "Add New Redirect URL" button.&lt;/li&gt;
&lt;li&gt;Enter "&lt;a href="https://localhost:3001" rel="noopener noreferrer"&gt;https://localhost:3001&lt;/a&gt;" and click "Add" button.&lt;/li&gt;
&lt;li&gt;Click "Save URLs" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then you can use authentication by Slack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create your application
&lt;/h2&gt;

&lt;p&gt;See also:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://next-auth.js.org/" rel="noopener noreferrer"&gt;https://next-auth.js.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an example, create application named &lt;em&gt;slack-auth-example&lt;/em&gt; by &lt;code&gt;create-next-app&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="n"&gt;slack&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, install packages from npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;bootstrap&lt;/span&gt; &lt;span class="n"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bootstrap&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  .env.development.local
&lt;/h3&gt;

&lt;p&gt;Put information depending your environment into &lt;code&gt;.env.development.local&lt;/code&gt; file as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;SLACK_CLIENT_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;Your client ID&amp;gt;"&lt;/span&gt;
&lt;span class="na"&gt;SLACK_CLIENT_SECRET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;Your client secret&amp;gt;"&lt;/span&gt;
&lt;span class="na"&gt;NEXTAUTH_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://localhost:3001"&lt;/span&gt;
&lt;span class="na"&gt;NEXTAUTH_SECRET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"changeit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Values for &lt;code&gt;SLACK_CLIENT_ID&lt;/code&gt; and &lt;code&gt;SLACK_CLIENT_SECRET&lt;/code&gt; are what you get in "Create a client ID and a client secret" section.&lt;/p&gt;

&lt;h3&gt;
  
  
  /api/auth/[...nextauth].ts
&lt;/h3&gt;

&lt;p&gt;This is the minimal configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;NextAuth&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"next-auth/next"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;SlackProvider&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"next-auth/providers/slack"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;authOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nc"&gt;SlackProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SLACK_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SLACK_CLIENT_SECRET&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nc"&gt;NextAuth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;authOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  pages/_app.tsx
&lt;/h3&gt;

&lt;p&gt;Surround Component with SessionProvider.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s1"&gt;'@/styles/globals.css'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;SessionProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'next-auth/react'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;AppProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'next/app'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pageProps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AppProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SessionProvider&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pageProps&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;SessionProvider&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example: index.tsx
&lt;/h3&gt;

&lt;p&gt;It shows login button. As you logged in, it shows your name and logout button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signOut&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;useSession&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"next-auth/react"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"react-bootstrap"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s2"&gt;"bootstrap/dist/css/bootstrap.min.css"&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSession&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"loading"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Loading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"authenticated"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;You&lt;/span&gt; &lt;span class="n"&gt;are&lt;/span&gt; &lt;span class="n"&gt;logged&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="n"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;signOut&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Logout&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="n"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;signIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"slack"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Login&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Integration with Prisma
&lt;/h2&gt;

&lt;p&gt;NextAuth.js has an adapter for using Prisma. Sessions can be managed in databases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://authjs.dev/reference/adapter/prisma" rel="noopener noreferrer"&gt;https://authjs.dev/reference/adapter/prisma&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="nd"&gt;@prisma&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="nd"&gt;@next&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;prisma&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;adapter&lt;/span&gt;
&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;D&lt;/span&gt; &lt;span class="n"&gt;prisma&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Prisma setup
&lt;/h3&gt;

&lt;p&gt;An example using MySQL is shown.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;prisma&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;datasource&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="n"&gt;mysql&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, edit &lt;code&gt;prisma.schema&lt;/code&gt; file as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mys"
  url      = env("DATABASE_URL")
}

model Account {
  id                 String  @id @default(cuid())
  userId             String
  type               String
  provider           String
  providerAccountId  String
  ok                 Boolean?
  refresh_token      String?  @db.Text
  access_token       String?  @db.Text
  expires_at         Int?
  token_type         String?
  scope              String?
  id_token           String?  @db.Text
  state              String?
  session_state      String?

  user User @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([provider, providerAccountId])
}

model Session {
  id           String   @id @default(cuid())
  sessionToken String   @unique
  userId       String
  expires      DateTime
  user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model User {
  id            String    @id @default(cuid())
  name          String?
  email         String?   @unique
  emailVerified DateTime?
  image         String?
  accounts      Account[]
  sessions      Session[]
}

model VerificationToken {
  identifier String
  token      String   @unique
  expires    DateTime

  @@unique([identifier, token])
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit following line in &lt;code&gt;.env.development.local&lt;/code&gt; file according to your environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"mysql://johndoe:randompassword@localhost:3306/mydb"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run a command as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;prisma&lt;/span&gt; &lt;span class="n"&gt;generate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Prisma client has been generated.&lt;/p&gt;

&lt;h3&gt;
  
  
  /api/auth/[...nextauth].ts
&lt;/h3&gt;

&lt;p&gt;Add &lt;code&gt;adapter&lt;/code&gt; property to &lt;code&gt;authOptions&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;PrismaAdapter&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"@next-auth/prisma-adapter"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;PrismaClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"@prisma/client"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;NextAuth&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"next-auth/next"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;SlackProvider&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"next-auth/providers/slack"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;prisma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PrismaClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;authOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;PrismaAdapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prisma&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nc"&gt;SlackProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SLACK_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SLACK_CLIENT_SECRET&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nc"&gt;NextAuth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;authOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Initialize database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;prisma&lt;/span&gt; &lt;span class="n"&gt;migrate&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="n"&gt;init&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  For your information
&lt;/h2&gt;

&lt;p&gt;Don't worry that outsiders can't log in even if they have an other domain Slack account. Because the client ID you got is tied to your Slack domain, only your Slack domain member can log in. It is not always necessary to hold user information in your database.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>node</category>
      <category>slack</category>
    </item>
    <item>
      <title>When you need HTTPS on LOCAL environment, local-ssl-proxy is the best solution</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Mon, 22 May 2023 03:15:09 +0000</pubDate>
      <link>https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6</link>
      <guid>https://dev.to/cress/when-you-need-https-on-local-environment-local-ssl-proxy-is-the-best-solution-24n6</guid>
      <description>&lt;p&gt;Implementing single-sign-on (SSO) with nextauth.js and Slack, LOCAL environment also needs HTTPS support. In this case, it is very easy and useful that using local-ssl-proxy like a reverse proxy server.&lt;/p&gt;

&lt;p&gt;This article is for Windows PC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing local-ssl-proxy
&lt;/h2&gt;

&lt;p&gt;Local-ssl-proxy only supports global installation. Install as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An example usage is below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="mi"&gt;3001&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, an application is running on port 3000. Run local-ssl-proxy on port 3001 targeting for port 3000.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/cameronhunter/local-ssl-proxy" rel="noopener noreferrer"&gt;https://github.com/cameronhunter/local-ssl-proxy&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  It works but SSL warnings
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;You'll get a warning because the certificate is self-signed, this is safe to ignore during development.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Create an effective certificate using mkcert.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing scoop
&lt;/h3&gt;

&lt;p&gt;On Windows, it is very easy that installing mkcert using scoop. Following the quickstart, run as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="nc"&gt;RemoteSigned&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Scope&lt;/span&gt; &lt;span class="nc"&gt;CurrentUser&lt;/span&gt;
&lt;span class="n"&gt;irm&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scoop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;iex&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://scoop.sh/" rel="noopener noreferrer"&gt;https://scoop.sh/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing mkcert
&lt;/h3&gt;

&lt;p&gt;Mkcert is the best solution for creating certificates on Windows. It is easier than installing OpenSSL and others as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;scoop&lt;/span&gt; &lt;span class="n"&gt;bucket&lt;/span&gt; &lt;span class="n"&gt;add&lt;/span&gt; &lt;span class="n"&gt;extras&lt;/span&gt;
&lt;span class="n"&gt;scoop&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;mkcert&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installation should be failed without Git. Install Git first if you don’t have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/FiloSottile/mkcert" rel="noopener noreferrer"&gt;https://github.com/FiloSottile/mkcert&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Running mkcert
&lt;/h3&gt;

&lt;p&gt;Create a local certificates authority (CA). The following command must be run as administrator privilege. If you have run as not administrator privilege, redo with running &lt;code&gt;mkcert -uninstall&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;mkcert&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, create a key and a certificate for localhost as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;mkcert&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should have gotten &lt;code&gt;localhost-key.pem&lt;/code&gt; and &lt;code&gt;localhost.pem&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running local-ssl-proxy with the certificate enabled
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;proxy&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;cert&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="mi"&gt;3001&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running local-ssl-proxy every time is exhausting
&lt;/h2&gt;

&lt;p&gt;Npm-run-all is the best solution. It can run multiple commands for serial or parallel. Install as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;D&lt;/span&gt; &lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, change package.json as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* package.json */&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npm-run-all -p dev:*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"dev:app"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"next dev"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"dev:ssl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"local-ssl-proxy --key localhost-key.pem --cert localhost.pem --source 3001 --target 3000"&lt;/span&gt;
    &lt;span class="cm"&gt;/* snipped */&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="cm"&gt;/* snipped */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running &lt;code&gt;npm run dev&lt;/code&gt;, commands matching with &lt;code&gt;dev:*&lt;/code&gt; will be run for parallel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/npm-run-all" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/npm-run-all&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Wildcard not expanded on powershell</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sun, 21 May 2023 18:33:13 +0000</pubDate>
      <link>https://dev.to/cress/wildcard-not-expanded-on-powershell-16cm</link>
      <guid>https://dev.to/cress/wildcard-not-expanded-on-powershell-16cm</guid>
      <description>&lt;h2&gt;
  
  
  What we want to do
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;python myapp.py folder/*.txt&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Correct usage
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;python myapp.py (Get-Item folder/*.txt)&lt;/code&gt;&lt;/p&gt;

</description>
      <category>powershel</category>
    </item>
    <item>
      <title>ORA-28000: the account is locked</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 20 May 2023 03:48:18 +0000</pubDate>
      <link>https://dev.to/cress/ora-28000-the-account-is-locked-l6d</link>
      <guid>https://dev.to/cress/ora-28000-the-account-is-locked-l6d</guid>
      <description>&lt;h2&gt;
  
  
  Who locked oracle database account?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If you have any idea, let me know right now!&lt;/strong&gt;&lt;br&gt;
But no one does, so we need to find out who locked it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Survey method
&lt;/h2&gt;

&lt;p&gt;For windows, you can find the error logs on Event Viewer. For Linux and others, on the Oracle alert logs. Its location is below:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$ORACLE_BASE/diag/rdbms/&amp;lt;SID&amp;gt;/&amp;lt;SID&amp;gt;/trace/alert_&amp;lt;SID&amp;gt;.log&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;First, find the line "ORA-28000: the account is locked". Then, find the line "ORA-01017: invalid username/password; logon denied" just before it. Because the most likely cause is wrong password.&lt;br&gt;
You can find the source host name printed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shout the source host name
&lt;/h2&gt;

&lt;p&gt;That is the culprit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Corrective action
&lt;/h2&gt;

&lt;p&gt;Make sure all members understand the above steps and that no one can escape from administrator.&lt;/p&gt;

</description>
      <category>oracle</category>
    </item>
    <item>
      <title>For English studying...</title>
      <dc:creator>Cress</dc:creator>
      <pubDate>Sat, 20 May 2023 02:55:36 +0000</pubDate>
      <link>https://dev.to/cress/for-english-studying-ec3</link>
      <guid>https://dev.to/cress/for-english-studying-ec3</guid>
      <description>&lt;p&gt;My new boss is a man from France.&lt;br&gt;
Body language doesn't work to him.&lt;br&gt;
I should study English again.&lt;/p&gt;

&lt;p&gt;The above is a part of a famous song in Japan.&lt;/p&gt;

&lt;p&gt;I am publishing a tech blog in Japanese, following:&lt;br&gt;
&lt;a href="https://qiita.com/cress_cc" rel="noopener noreferrer"&gt;https://qiita.com/cress_cc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But there is not enough tech information in Japanese, and so is English.&lt;br&gt;
Therefore, I'll write tech articles while studying English.&lt;/p&gt;

&lt;p&gt;Sorry for my poor English, and thank you for reading.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
  </channel>
</rss>
