<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>パスワードレス &#8211; WordPress Memo</title>
	<atom:link href="https://blog.riverforest-wp.info/tag/%E3%83%91%E3%82%B9%E3%83%AF%E3%83%BC%E3%83%89%E3%83%AC%E3%82%B9/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.riverforest-wp.info</link>
	<description>WordPress に関する覚え書き</description>
	<lastBuildDate>Fri, 09 May 2025 12:48:52 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://blog.riverforest-wp.info/wp-content/uploads/2018/05/cropped-icon-256x256-1-32x32.png</url>
	<title>パスワードレス &#8211; WordPress Memo</title>
	<link>https://blog.riverforest-wp.info</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>パスワードレスログインの為のプラグイン</title>
		<link>https://blog.riverforest-wp.info/magic-login-mail/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Wed, 05 Jan 2022 00:09:01 +0000</pubDate>
				<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Webサービス]]></category>
		<category><![CDATA[パスワードレス]]></category>
		<category><![CDATA[ログイン]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=2936</guid>

					<description><![CDATA[はじめに Web サービス（競技会採点システム COMPE-Scoring）上で、パスワードレスログインのために、Passwordless Login というプラグインを使用していました。ログイン時にメールアドレスを入力 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p class="wp-block-paragraph">Web サービス（<strong>競技会採点システム COMPE-Scoring</strong>）上で、パスワードレスログインのために、<strong>Passwordless Login</strong> というプラグインを使用していました。ログイン時にメールアドレスを入力し、返信されてきたメールのマジックリンクをクリックするとログインできるというものです。ユーザーは２アクション必須なのですが、ログインしているユーザーの管理画面上から複数のユーザー宛てにマジックリンク付きのメールを送信する必要があり、<strong>Magic Login Mail</strong> を作成しました。以下の<strong>動作</strong>の、最初～15秒までが、２アクションのもの、22秒～最後までが１アクションのものです。</p>



<p class="wp-block-paragraph"><strong>Passwordless Login</strong> を改変したものです。コードを見て、ん？と思うところを修正・削除し、上記の１アクションの機能をアクションフックとして追加しました。</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-3a88641f wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<style>
.simpleblogcard_img_block39f2d07281da2d1cd1bbd8ee87873e63 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border39f2d07281da2d1cd1bbd8ee87873e63 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title39f2d07281da2d1cd1bbd8ee87873e63 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description39f2d07281da2d1cd1bbd8ee87873e63 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://compe-scoring.com/ja/>
			<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border39f2d07281da2d1cd1bbd8ee87873e63">
			compe-scoring.com			<div class="simpleblogcard_title39f2d07281da2d1cd1bbd8ee87873e63">
				https://compe-scoring.com/ja/			</div>
							<div class="simpleblogcard_description39f2d07281da2d1cd1bbd8ee87873e63">
									</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="pluginstatsview-simple-wrap">
	<div>
		<img decoding="async" src="https://ps.w.org/passwordless-login/assets/icon-256x256.png?rev=2190567" alt="Passwordless Login のアイコン" class="pluginstatsview-simple-icon" />
		<div class="pluginstatsview-after-icon">
			<div class="pluginstatsview-bold"><a href="https://www.cozmoslabs.com" class="pluginstatsview-astyle">Passwordless Login</a></div>
			<div class="pluginstatsview-small"><a href="https://www.cozmoslabs.com#reviews" title="5.0(5点満点中)" class="pluginstatsview-astyle">	<span class="pluginstatsview-stars">
					<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
			</span>
	</a></div>
			<div class="pluginstatsview-small">1,000以上サイトで有効化中</div>
		</div>
	</div>
	<div style="clear: both;"></div>
	<div class="pluginstatsview-small">2026-05-21 06:45 時点の統計</div>
</div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="pluginstatsview-simple-wrap">
	<div>
		<img decoding="async" src="https://ps.w.org/magic-login-mail/assets/icon-256x256.png?rev=2649698" alt="Magic Login Mail or QR Code のアイコン" class="pluginstatsview-simple-icon" />
		<div class="pluginstatsview-after-icon">
			<div class="pluginstatsview-bold"><a href="https://wordpress.org/plugins/magic-login-mail/" class="pluginstatsview-astyle">Magic Login Mail or QR Code</a></div>
			<div class="pluginstatsview-small"><a href="https://wordpress.org/plugins/magic-login-mail/#reviews" title="5.0(5点満点中)" class="pluginstatsview-astyle">	<span class="pluginstatsview-stars">
					<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
			</span>
	</a></div>
			<div class="pluginstatsview-small">100以上サイトで有効化中</div>
		</div>
	</div>
	<div style="clear: both;"></div>
	<div class="pluginstatsview-small">2026-05-21 06:45 時点の統計</div>
</div>
</div>
</div>



<h3 class="wp-block-heading">動作</h3>



<figure class="wp-block-video"><video height="720" style="aspect-ratio: 1280 / 720;" width="1280" controls muted src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/magic-login-mail.mp4"></video></figure>



<h3 class="wp-block-heading">使い方</h3>



<ul class="wp-block-list"><li>固定ページに、<code class="language-php language-html">[magic_login]</code>というショートコードを設置するだけです。そのページがログインの為のページになります。</li></ul>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6a0e2e75eea9e&quot;}" data-wp-interactive="core/image" data-wp-key="6a0e2e75eea9e" class="wp-block-image size-large wp-lightbox-container"><img fetchpriority="high" loading="eager" decoding="async" width="1024" height="576" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-1-1024x576.png" alt="" class="wp-image-2946" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-1-1024x576.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-1-300x169.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-1-768x432.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-1.png 1284w" sizes="(max-width: 1024px) 100vw, 1024px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<ul class="wp-block-list"><li>ユーザーとして登録されたメールアドレスが入力されると、ログインリンクを含むメールが送信されたというメッセージが出力され、メールにログインリンクが届き、リンクをクリックするとログインします。</li></ul>



<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="1024" height="584" src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-2-1024x584.png" alt="" data-id="2947" data-full-url="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-2.png" data-link="https://blog.riverforest-wp.info/screenshot-2-24/" class="wp-image-2947" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-2-1024x584.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-2-300x171.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-2-768x438.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-2.png 1267w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="1024" height="584" src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-3-1024x584.png" alt="" data-id="2948" data-full-url="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-3.png" data-link="https://blog.riverforest-wp.info/screenshot-3-16/" class="wp-image-2948" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-3-1024x584.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-3-300x171.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-3-768x438.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-3.png 1267w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="1024" height="576" src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-4-1024x576.png" alt="" data-id="2949" data-full-url="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-4.png" data-link="https://blog.riverforest-wp.info/screenshot-4-8/" class="wp-image-2949" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-4-1024x576.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-4-300x169.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-4-768x432.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-4.png 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></li></ul></figure>



<ul class="wp-block-list"><li>ユーザーとして登録されていないメールアドレスを入力するとエラーが出ます。デフォルトでは１０分以内に、リンクをクリックしないと期限切れのエラーが出ます。</li></ul>



<figure class="wp-block-gallery columns-2 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="1024" height="584" src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-5-1024x584.png" alt="" data-id="2950" data-full-url="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-5.png" data-link="https://blog.riverforest-wp.info/screenshot-5-4/" class="wp-image-2950" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-5-1024x584.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-5-300x171.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-5-768x438.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-5.png 1267w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="1024" height="584" src="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-6-1024x584.png" alt="" data-id="2951" data-full-url="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-6.png" data-link="https://blog.riverforest-wp.info/screenshot-6-4/" class="wp-image-2951" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-6-1024x584.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-6-300x171.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-6-768x438.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20220105/screenshot-6.png 1267w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></li></ul></figure>



<h3 class="wp-block-heading">カスタマイズ</h3>



<p class="wp-block-paragraph">管理画面はありません。カスタマイズは、フィルターフックとアクションフックで行います。上記のリンク先に、サンプルコードが書いてありますので、それを見て行ってください。</p>



<h3 class="wp-block-heading">セキュリティ対策</h3>



<p class="wp-block-paragraph">このプラグインと併せて以下の様なセキュリティ対策を行う事もできると思います。</p>



<p class="wp-block-paragraph">wp-login.php にアクセスしてきたら、ホームページへリダイレクトする</p>



<pre class="prism line-numbers"><code class="language-php language-html">/** ==================================================
 * Redirect to home if the URI is wp-login.php
 *
 * @since 1.00
 */
function redirect_login() {
	if ( ! is_user_logged_in() &amp;&amp; isset( $_SERVER&#91;'REQUEST_URI'] ) &amp;&amp; ! empty( $_SERVER&#91;'REQUEST_URI'] ) ) {
		$request_uri = esc_url_raw( wp_unslash( $_SERVER&#91;'REQUEST_URI'] ) );
		if ( 'wp-login.php' === wp_basename( parse_url( $request_uri, PHP_URL_PATH ) ) ) {
			wp_safe_redirect( home_url(), 302 );
			exit();
		}
	}
}
add_action( 'init', 'redirect_login' );</code></pre>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		<enclosure url="https://blog.riverforest-wp.info/wp-content/uploads/20220105/magic-login-mail.mp4" length="27925728" type="video/mp4" />

			</item>
	</channel>
</rss>
