<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Logto docs Blog</title>
        <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to</link>
        <description>Logto docs Blog</description>
        <lastBuildDate>Wed, 08 Apr 2026 17:38:48 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>th</language>
        <item>
            <title><![CDATA[วิธีสร้าง Okta enterprise SSO ด้วย ปลั๊กอิน WordPress]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Okta enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a></li>
<li class="">มีบัญชี <!-- -->Okta enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->เว็บแบบดั้งเดิม<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->เว็บแบบดั้งเดิม<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->เว็บแบบดั้งเดิม<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->WordPress<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม WordPress กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="install-the-plugin">ติดตั้งปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#install-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" title="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">จากแผงผู้ดูแล WordPress</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">จากการอัปโหลด</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><ol>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong>.</li>
<li class="">ค้นหา "Logto" หรือกรอก <span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">https://wordpress.org/plugins/logto/<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในช่องค้นหา</li>
<li class="">คลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div><div role="tabpanel" class="tabItem_pED3" hidden=""><ol>
<li class="">ดาวน์โหลดปลั๊กอิน Logto WordPress จากลิงก์ใดลิงก์หนึ่งต่อไปนี้:<!-- -->
<ul>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/wordpress/releases" target="_blank" rel="noopener noreferrer" class="link_hf7f">รุ่นล่าสุด (Latest release)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์ที่มีชื่อในรูปแบบ <code>logto-plugin-&lt;version&gt;.zip</code></li>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไดเรกทอรีปลั๊กอิน WordPress (WordPress plugin directory)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์โดยคลิกปุ่ม <strong>ดาวน์โหลด (Download)</strong></li>
</ul>
</li>
<li class="">ดาวน์โหลดไฟล์ ZIP ของปลั๊กอิน</li>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong> ในแผงผู้ดูแล WordPress ของคุณ</li>
<li class="">คลิก <strong>อัปโหลดปลั๊กอิน (Upload Plugin)</strong></li>
<li class="">เลือกไฟล์ ZIP ที่ดาวน์โหลดมาแล้วคลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-the-plugin">ตั้งค่าปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" title="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" translate="no">​</a></h3>
<p>ตอนนี้คุณควรจะเห็นเมนู Logto ในแถบด้านข้างของแผงผู้ดูแล WordPress ของคุณ คลิก <strong>Logto</strong> &gt; <strong>Settings</strong> เพื่อกำหนดค่าปลั๊กอิน</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>คุณควรสร้างแอปพลิเคชัน <strong>เว็บแบบดั้งเดิม (traditional web)</strong> ใน Logto Console ก่อนตั้งค่าปลั๊กอิน หากคุณยังไม่ได้สร้าง โปรดดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/integrate-logto/integrate-logto-into-your-application" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>การผสาน Logto เข้ากับแอปพลิเคชันของคุณ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับข้อมูลเพิ่มเติม</p></div></div></div>
<p>การตั้งค่าขั้นต่ำที่จำเป็นสำหรับเริ่มต้นใช้งานปลั๊กอินคือ:</p>
<ul>
<li class="">Logto endpoint: จุดปลายทางของ Logto tenant ของคุณ</li>
<li class="">App ID: รหัสแอปของแอปพลิเคชัน Logto ของคุณ</li>
<li class="">App secret: หนึ่งในรหัสลับแอปที่ถูกต้องของแอปพลิเคชัน Logto ของคุณ</li>
</ul>
<p>ค่าทั้งหมดนี้สามารถดูได้ที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<p>หลังจากกรอกค่าแล้ว คลิก <strong>บันทึกการเปลี่ยนแปลง (Save Changes)</strong> (เลื่อนลงไปด้านล่างของหน้า หากไม่พบปุ่ม)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">ตั้งค่า redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" title="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" translate="no">​</a></h3>
<p>Redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากยืนยันตัวตนเสร็จ; และ post sign-out redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากออกจากระบบ</p>
<p>นี่คือไดอะแกรมลำดับ (sequence diagram) แบบไม่เป็นทางการเพื่อแสดงขั้นตอนการลงชื่อเข้าใช้:</p>
<!-- -->
<p>นี่คือขั้นตอนการออกจากระบบในไดอะแกรมลำดับแบบไม่เป็นทางการ:</p>
<!-- -->
<p>หากต้องการเรียนรู้เพิ่มเติมว่าทำไมต้องมีการเปลี่ยนเส้นทาง ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p>ในกรณีนี้ คุณต้องตั้งค่าทั้งสอง redirect URI ใน Logto Console ของคุณ วิธีค้นหา redirect URI ให้ไปที่หน้า <strong>Logto</strong> &gt; <strong>Settings</strong> ในแผงผู้ดูแล WordPress ของคุณ คุณจะเห็นฟิลด์ <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong></p>
<ol>
<li class="">คัดลอกค่า <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong> แล้ววางลงในฟิลด์ <strong>Redirect URIs</strong> และ <strong>Post sign-out redirect URIs</strong> ใน Logto Console ของคุณ</li>
<li class="">คลิก <strong>บันทึกการเปลี่ยนแปลง (Save changes)</strong> ใน Logto Console</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-website">จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#checkpoint-test-your-website" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบการผสาน Logto ในเว็บไซต์ WordPress ของคุณได้แล้ว:</p>
<ol>
<li class="">เปิดหน้าต่างเบราว์เซอร์แบบไม่ระบุตัวตนหากจำเป็น</li>
<li class="">เข้าเว็บไซต์ WordPress ของคุณแล้วคลิก <strong>เข้าสู่ระบบ (Log in)</strong> หากมี; หรือเข้าหน้าล็อกอินโดยตรง (เช่น <code>https://example.com/wp-login.php</code>)</li>
<li class="">หน้าจะเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">ดำเนินการลงชื่อเข้าใช้หรือสมัครสมาชิกให้เสร็จสิ้น</li>
<li class="">หลังจากยืนยันตัวตนสำเร็จ คุณจะถูกเปลี่ยนเส้นทางกลับไปยังเว็บไซต์ WordPress ของคุณและเข้าสู่ระบบโดยอัตโนมัติ</li>
<li class="">คลิก <strong>ออกจากระบบ (Log out)</strong> เพื่อออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกเปลี่ยนเส้นทางไปยังหน้าออกจากระบบของ Logto แล้วกลับไปยังเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
</ol>
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการตั้งค่าปลั๊กอิน WordPress โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/quick-starts/wordpress-plugin" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>เริ่มต้นใช้งาน WordPress อย่างรวดเร็ว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Okta enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->WordPress<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-okta-admin-portal">ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-1-create-an-oidc-application-on-okta-admin-portal" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" translate="no">​</a></h3>
<ul>
<li class="">ไปที่พอร์ทัลผู้ดูแลระบบ Okta และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">ไปที่หน้า <code>Applications</code> / <code>Applications</code> โดยใช้เมนูด้านข้าง</li>
<li class="">คลิกปุ่ม <code>Create App Integration</code> เพื่อสร้างแอป OIDC ใหม่</li>
<li class="">เลือกตัวเลือก <code>OIDC - OpenID Connect</code> เป็น <code>Sign-in method</code></li>
<li class="">เลือกตัวเลือก <code>Web Application</code> เป็น <code>Application type</code></li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_create_application.webp" alt="สร้างแอปพลิเคชัน Okta">
<p>คลิกปุ่ม <code>Next</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-the-application-settings">ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-2-configure-the-application-settings" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" translate="no">​</a></h3>
<ol>
<li class="">กำหนด <code>App integration name</code> ซึ่งจะใช้เป็นตัวระบุของแอปพลิเคชัน OIDC ของคุณ</li>
<li class="">เพิ่ม <code>Sign-in redirect URIs</code> ใหม่โดยใช้ callback URL ของตัวเชื่อมต่อ Logto SSO</li>
</ol>
<p>นี่คือ URI ที่ Okta จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตน (Authentication) สำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI ที่กำหนดนี้พร้อมกับรหัสการอนุญาต (authorization code) Logto จะดำเนินการยืนยันตัวตน (Authentication) ให้สมบูรณ์โดยอิงจากรหัสการอนุญาตที่ได้รับจาก URI นี้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_application_settings.webp" alt="การตั้งค่าแอปพลิเคชัน Okta">
<ol start="3">
<li class="">กำหนดผู้ใช้ให้กับแอปพลิเคชัน</li>
</ol>
<p>ตามการตั้งค่า <code>Assignments</code> คุณสามารถเลือกกำหนดแอปพลิเคชันให้กับผู้ใช้ทั้งหมด หรือเฉพาะผู้ใช้ / กลุ่มที่ต้องการ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_assign_users.webp" alt="Okta assign users">
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าแอปพลิเคชัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-3-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC สำเร็จแล้ว คุณจะถูกเปลี่ยนเส้นทางไปยังหน้ารายละเอียดของแอปพลิเคชัน</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_client_credentials.webp" alt="Okta client credentials">
<p>คัดลอก <code>client ID</code> และ <code>client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ใช้โดเมน Okta ของคุณเป็น <code>issuer</code> ตัวอย่าง: <code>https://dev-12345678.okta.com</code> เมื่อกรอกข้อมูลครบทุกช่องแล้ว ให้คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าตัวเชื่อมต่อ</p>
<p>หากลิงก์ <code>issuer</code> ที่คุณให้มาถูกต้อง คุณจะเห็นรายการการตั้งค่า Okta IdP ที่ถูกแยกแสดงแบบเต็มด้านล่างช่อง <code>issuer</code></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-additional-scopes-optional">ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-4-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Okta ของพวกเขาได้ การร้องขอสิทธิ์ Okta เพิ่มเติมจำเป็นต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Okta admin console:</strong></p>
<ol>
<li class="">ไปที่ <strong>Applications &gt; Applications</strong> และเลือกแอป OIDC ของคุณ</li>
<li class="">ไปที่แท็บ <strong>Assignments</strong> เพื่อให้แน่ใจว่าแอปของคุณสามารถเข้าถึงผู้ใช้และกลุ่มที่ต้องการได้</li>
<li class="">สำหรับขอบเขตแบบกำหนดเอง ให้ไปที่ <strong>Security &gt; API &gt; Authorization Servers</strong> และเลือก authorization server ของคุณ</li>
<li class="">เพิ่มขอบเขตแบบกำหนดเองหากจำเป็น:<!-- -->
<ul>
<li class="">คลิก <strong>Scopes</strong> แล้วเลือก <strong>Add Scope</strong></li>
<li class="">กำหนดชื่อขอบเขต เช่น <code>okta.users.read</code> หรือ <code>okta.groups.read</code> สำหรับการเข้าถึง Okta APIs</li>
<li class="">กำหนดข้อกำหนดการขอความยินยอม (consent) สำหรับแต่ละขอบเขต</li>
</ul>
</li>
</ol>
<p>สำหรับรายการขอบเขตที่มีทั้งหมดและคำอธิบาย โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/api/openapi/okta-oauth/guides/overview/#scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสาร Okta OIDC<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ใน Logto Okta connector:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณต้องการจัดเก็บโทเค็นเพื่อเข้าถึง API แบบถาวร ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรช (Refresh token) สำหรับการเข้าถึง API ระยะยาว</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Okta เช่น <code>okta.users.read okta.groups.read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Okta APIs และดำเนินการต่าง ๆ โปรดตรวจสอบให้แน่ใจว่าได้เปิดใช้งาน <strong>Store tokens for persistent API access</strong> ใน Logto Okta connector ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-store-tokens-to-access-okta-apis-optional">ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-5-store-tokens-to-access-okta-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/guides/request-user-consent/main/#enable-consent-for-scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">Okta scopes<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต (scopes) เฉพาะและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าตั้งค่าสิทธิ์ API ของ Okta developer console และในตัวเชื่อมต่อ Okta ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API แบบถาวร</strong> ในตัวเชื่อมต่อ Okta ของ Logto โดย Logto จะจัดเก็บ Okta access และ refresh tokens อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่า refresh tokens จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอป Okta ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Okta ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-6-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการสร้างการเชื่อมต่อ OIDC กับ Okta โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://help.okta.com/oie/en-us/content/topics/apps/apps_app_integration_wizard_oidc.htm" target="_blank" rel="noopener noreferrer" class="link_hf7f">Create OIDC App Integrations<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Okta enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->ปลั๊กอิน WordPress<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Okta enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>okta-enterprise-sso</category>
            <category>wordpress-plugin</category>
            <category>php</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Google Workspace enterprise SSO ด้วย Vue]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Google Workspace enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a></li>
<li class="">มีบัญชี <!-- -->Google Workspace enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vue<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vue กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">Logto Vue SDK ถูกสร้างขึ้นด้วย composition API และใช้ composables ดังนั้นจึงรองรับเฉพาะ Vue 3 เท่านั้น</li>
<li class="">วิดีโอแนะนำมีให้รับชมบน <span class="linkWrapper_B4Bt"><a href="https://youtu.be/cAfsQrsGQqA" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">โปรเจกต์ตัวอย่างฉบับเต็มสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/vue-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>createLogto</code> เพื่อติดตั้งปลั๊กอิน Logto:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">main.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> LogtoConfig </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createApp </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> App </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'./App.vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// กำหนดค่าการเชื่อมต่อ Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> LogtoConfig </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> app </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">App</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">mount</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#app'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีสิ่งที่ต้องทำหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการให้ถูกต้องกัน</p>
<p>ก่อนอื่น สร้างหน้าคอลแบ็ก (callback) ดังนี้:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/CallbackView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> useHandleSignInCallback </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> router </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@/router'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขณะกำลังดำเนินการ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">isLoading</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>แทรกโค้ดด้านล่างในเส้นทาง <code>/callback</code> ของคุณ ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">router/index.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ vue-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> router </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createRouter</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  routes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      path</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      component</span><span class="token operator">:</span><span class="token plain"> CallbackView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี composable สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ที่ช่วยให้คุณจัดการโฟลว์การยืนยันตัวตนได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/HomeView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ดึงฟังก์ชัน signIn, signOut และตัวแปร isAuthenticated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">!isAuthenticated</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignIn</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ลงชื่อเข้าใช้</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-else</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignOut</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ออกจากระบบ</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vue<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Google Cloud Platform<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Google Cloud Platform" title="ลิงก์ตรงไปยัง ตั้งค่า Google Cloud Platform" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-a-new-project-on-google-cloud-platform">ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-1-create-a-new-project-on-google-cloud-platform" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform" translate="no">​</a></h3>
<p>ก่อนที่คุณจะสามารถใช้ Google Workspace เป็นผู้ให้บริการการยืนยันตัวตน (authentication provider) ได้ คุณต้องตั้งค่าโปรเจกต์ใน <span class="linkWrapper_B4Bt"><a href="https://console.developers.google.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google API Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อขอรับข้อมูลประจำตัว OAuth 2.0 หากคุณมีโปรเจกต์อยู่แล้ว สามารถข้ามขั้นตอนนี้ได้ หากยังไม่มี ให้สร้างโปรเจกต์ใหม่ภายใต้องค์กร Google ของคุณ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-config-the-consent-screen-for-your-application">ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-2-config-the-consent-screen-for-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>เพื่อสร้างข้อมูลรับรอง OIDC ใหม่ คุณต้องกำหนดค่าหน้าขอความยินยอม (Consent Screen) สำหรับแอปพลิเคชันของคุณ</p>
<ol>
<li class="">ไปที่หน้า <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/credentials/consent" target="_blank" rel="noopener noreferrer" class="link_hf7f">OAuth consent screen<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และเลือกประเภทผู้ใช้ <code>Internal</code> การตั้งค่านี้จะทำให้แอป OAuth สามารถใช้งานได้เฉพาะผู้ใช้ภายในองค์กรของคุณเท่านั้น</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_user_type.webp" alt="ประเภทผู้ใช้ในหน้าขอความยินยอมของ Google Workspace">
<ol start="2">
<li class="">กรอกการตั้งค่า <code>Consent Screen</code> ตามคำแนะนำบนหน้า คุณต้องระบุข้อมูลขั้นต่ำดังต่อไปนี้:</li>
</ol>
<ul>
<li class=""><strong>ชื่อแอปพลิเคชัน (Application name)</strong>: ชื่อของแอปพลิเคชันของคุณ ซึ่งจะแสดงบนหน้าขอความยินยอม</li>
<li class=""><strong>อีเมลสำหรับติดต่อ (Support email)</strong>: อีเมลสำหรับติดต่อของแอปพลิเคชัน ซึ่งจะแสดงบนหน้าขอความยินยอม</li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_settings.webp" alt="การตั้งค่าหน้าขอความยินยอมของ Google Workspace">
<ol start="3">
<li class="">กำหนด <code>ขอบเขต (Scopes)</code> สำหรับแอปพลิเคชันของคุณ เพื่อดึงข้อมูลตัวตนและอีเมลของผู้ใช้อย่างถูกต้องจาก IdP ตัวเชื่อมต่อ SSO ของ Logto จำเป็นต้องขอขอบเขตต่อไปนี้จาก IdP:</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_scopes.webp" alt="ขอบเขตในหน้าขอความยินยอมของ Google Workspace">
<ul>
<li class=""><strong>openid</strong>: ขอบเขตนี้จำเป็นสำหรับการยืนยันตัวตน OIDC ใช้สำหรับดึงโทเค็น ID (ID token) และเข้าถึง endpoint userInfo ของ IdP</li>
<li class=""><strong>profile</strong>: ขอบเขตนี้จำเป็นสำหรับการเข้าถึงข้อมูลโปรไฟล์พื้นฐานของผู้ใช้</li>
<li class=""><strong>email</strong>: ขอบเขตนี้จำเป็นสำหรับการเข้าถึงที่อยู่อีเมลของผู้ใช้</li>
</ul>
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าหน้าขอความยินยอม</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-create-a-new-oauth-credential">ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-3-create-a-new-oauth-credential" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่" translate="no">​</a></h3>
<p>ไปที่หน้า <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener noreferrer" class="link_hf7f">Credentials<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม <code>Create Credentials</code> จากนั้นเลือกตัวเลือก <code>OAuth client ID</code> จากเมนูดรอปดาวน์เพื่อสร้าง OAuth credential ใหม่สำหรับแอปพลิเคชันของคุณ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_create_credentials.webp" alt="Google Workspace create credentials">
<p>ดำเนินการตั้งค่า OAuth credential ต่อโดยกรอกข้อมูลดังต่อไปนี้:</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_credentials_config.webp" alt="Google Workspace credentials config">
<ol>
<li class="">เลือก <code>Web application</code> เป็นประเภทของแอปพลิเคชัน</li>
<li class="">กรอก <code>Name</code> ของแอปพลิเคชันลูกข่ายของคุณ เช่น <code>Logto SSO Connector</code> เพื่อช่วยให้คุณระบุ credential นี้ได้ในอนาคต</li>
<li class="">กรอก <code>Authorized redirect URIs</code> ด้วย Logto callback URI นี่คือ URI ที่ Google จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตนสำเร็จ หลังจากผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI นี้พร้อมกับ authorization code Logto จะดำเนินการยืนยันตัวตนให้สมบูรณ์โดยอิงจาก authorization code ที่ได้รับจาก URI นี้</li>
<li class="">กรอก <code>Authorized JavaScript origins</code> ด้วย origin ของ Logto callback URI เพื่อให้แน่ใจว่าเฉพาะแอป Logto ของคุณเท่านั้นที่สามารถส่งคำขอไปยัง Google OAuth server ได้</li>
<li class="">คลิกปุ่ม <code>Create</code> เพื่อสร้าง OAuth credential</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-4-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์" translate="no">​</a></h3>
<p>หลังจากสร้างข้อมูลประจำตัว OAuth สำเร็จแล้ว คุณจะได้รับหน้าต่างแจ้งเตือนที่แสดง client ID และ client secret</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_create_credentials.webp" alt="Google Workspace create credentials">
<p>คัดลอก <code>Client ID</code> และ <code>Client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ขณะนี้คุณได้ตั้งค่าตัวเชื่อมต่อ Google Workspace SSO บน Logto สำเร็จแล้ว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-additional-scopes-optional">ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-5-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Google Workspace ของพวกเขาได้ การร้องขอสิทธิ์ของ Google จำเป็นต้องมีการตั้งค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Google Cloud Console:</strong></p>
<ol>
<li class="">ไปที่ <strong>APIs &amp; Services &gt; OAuth consent screen &gt; Scopes</strong></li>
<li class="">คลิก <strong>Add or Remove Scopes</strong> และเลือกเฉพาะขอบเขตที่แอปของคุณต้องการ:<!-- -->
<ul>
<li class="">การยืนยันตัวตน (Authentication) (จำเป็น):<!-- -->
<ul>
<li class=""><code>https://www.googleapis.com/auth/userinfo.email</code></li>
<li class=""><code>https://www.googleapis.com/auth/userinfo.profile</code></li>
<li class=""><code>openid</code></li>
</ul>
</li>
<li class="">การเข้าถึง API (ไม่บังคับ): เพิ่มขอบเขตเพิ่มเติมที่แอปของคุณต้องการ (เช่น Drive, Calendar, YouTube) ค้นหาบริการที่มีได้ใน <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/library" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google API Library<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> หากแอปของคุณต้องการเข้าถึง Google API เกินกว่าสิทธิ์พื้นฐาน ให้เปิดใช้งาน API เฉพาะที่แอปของคุณจะใช้ก่อน (เช่น Google Drive API, Gmail API, Calendar API) ใน Google API Library</li>
</ul>
</li>
<li class="">คลิก <strong>Update</strong> เพื่อยืนยันการเลือก</li>
<li class="">คลิก <strong>Save and Continue</strong> เพื่อบันทึกการเปลี่ยนแปลง</li>
</ol>
<p><strong>ในตัวเชื่อมต่อ Google Workspace ของ Logto:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลเอกลักษณ์ผู้ใช้พื้นฐาน คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Google โดยใช้ URL ขอบเขตแบบเต็ม ตัวอย่างเช่น: <code>https://www.googleapis.com/auth/calendar.readonly</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Google API และดำเนินการต่าง ๆ โปรดเปิดใช้งาน <strong>Store tokens for persistent API access</strong> ในตัวเชื่อมต่อ Google ของ Logto ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-store-tokens-to-access-google-apis-optional">ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-6-store-tokens-to-access-google-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/library" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google APIs<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่ต้องการในหน้าการตั้งค่าความยินยอม OAuth ของ Google Cloud Console และในตัวเชื่อมต่อ Google ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Google ของ Logto Logto จะจัดเก็บโทเค็นการเข้าถึง Google และโทเค็นรีเฟรช Google ไว้อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่าจะได้รับโทเค็นรีเฟรช ให้ตั้งค่าตัวเชื่อมต่อ Google ของ Logto ให้เปิดใช้งาน <strong>Offline Access</strong></li>
</ol>
<div class="theme-admonition theme-admonition-warning admonition_Gfwi alert alert--warning"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">คำเตือน<!-- -->:</span><p>คุณไม่จำเป็นต้องเพิ่ม <code>offline_access</code> ในช่อง <code>Scope</code> ของ Logto — การเพิ่มอาจทำให้เกิดข้อผิดพลาด Google จะใช้ <code>access_type=offline</code> โดยอัตโนมัติเมื่อเปิดใช้งาน offline access</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-7-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#step-7-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับข้อมูลเพิ่มเติมเกี่ยวกับตัวเชื่อมต่อ Google Workspace SSO โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developers.google.com/identity/openid-connect/openid-connect" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google OpenID Connector<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Google Workspace enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vue<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Google Workspace enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vue-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>google-workspace-enterprise-sso</category>
            <category>vue</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Microsoft Entra ID SAML enterprise SSO ด้วย ปลั๊กอิน WordPress]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a></li>
<li class="">มีบัญชี <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->เว็บแบบดั้งเดิม<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->เว็บแบบดั้งเดิม<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->เว็บแบบดั้งเดิม<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->WordPress<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม WordPress กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="install-the-plugin">ติดตั้งปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#install-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" title="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">จากแผงผู้ดูแล WordPress</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">จากการอัปโหลด</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><ol>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong>.</li>
<li class="">ค้นหา "Logto" หรือกรอก <span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">https://wordpress.org/plugins/logto/<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในช่องค้นหา</li>
<li class="">คลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div><div role="tabpanel" class="tabItem_pED3" hidden=""><ol>
<li class="">ดาวน์โหลดปลั๊กอิน Logto WordPress จากลิงก์ใดลิงก์หนึ่งต่อไปนี้:<!-- -->
<ul>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/wordpress/releases" target="_blank" rel="noopener noreferrer" class="link_hf7f">รุ่นล่าสุด (Latest release)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์ที่มีชื่อในรูปแบบ <code>logto-plugin-&lt;version&gt;.zip</code></li>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไดเรกทอรีปลั๊กอิน WordPress (WordPress plugin directory)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์โดยคลิกปุ่ม <strong>ดาวน์โหลด (Download)</strong></li>
</ul>
</li>
<li class="">ดาวน์โหลดไฟล์ ZIP ของปลั๊กอิน</li>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong> ในแผงผู้ดูแล WordPress ของคุณ</li>
<li class="">คลิก <strong>อัปโหลดปลั๊กอิน (Upload Plugin)</strong></li>
<li class="">เลือกไฟล์ ZIP ที่ดาวน์โหลดมาแล้วคลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-the-plugin">ตั้งค่าปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" title="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" translate="no">​</a></h3>
<p>ตอนนี้คุณควรจะเห็นเมนู Logto ในแถบด้านข้างของแผงผู้ดูแล WordPress ของคุณ คลิก <strong>Logto</strong> &gt; <strong>Settings</strong> เพื่อกำหนดค่าปลั๊กอิน</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>คุณควรสร้างแอปพลิเคชัน <strong>เว็บแบบดั้งเดิม (traditional web)</strong> ใน Logto Console ก่อนตั้งค่าปลั๊กอิน หากคุณยังไม่ได้สร้าง โปรดดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/integrate-logto/integrate-logto-into-your-application" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>การผสาน Logto เข้ากับแอปพลิเคชันของคุณ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับข้อมูลเพิ่มเติม</p></div></div></div>
<p>การตั้งค่าขั้นต่ำที่จำเป็นสำหรับเริ่มต้นใช้งานปลั๊กอินคือ:</p>
<ul>
<li class="">Logto endpoint: จุดปลายทางของ Logto tenant ของคุณ</li>
<li class="">App ID: รหัสแอปของแอปพลิเคชัน Logto ของคุณ</li>
<li class="">App secret: หนึ่งในรหัสลับแอปที่ถูกต้องของแอปพลิเคชัน Logto ของคุณ</li>
</ul>
<p>ค่าทั้งหมดนี้สามารถดูได้ที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<p>หลังจากกรอกค่าแล้ว คลิก <strong>บันทึกการเปลี่ยนแปลง (Save Changes)</strong> (เลื่อนลงไปด้านล่างของหน้า หากไม่พบปุ่ม)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">ตั้งค่า redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" title="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" translate="no">​</a></h3>
<p>Redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากยืนยันตัวตนเสร็จ; และ post sign-out redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากออกจากระบบ</p>
<p>นี่คือไดอะแกรมลำดับ (sequence diagram) แบบไม่เป็นทางการเพื่อแสดงขั้นตอนการลงชื่อเข้าใช้:</p>
<!-- -->
<p>นี่คือขั้นตอนการออกจากระบบในไดอะแกรมลำดับแบบไม่เป็นทางการ:</p>
<!-- -->
<p>หากต้องการเรียนรู้เพิ่มเติมว่าทำไมต้องมีการเปลี่ยนเส้นทาง ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p>ในกรณีนี้ คุณต้องตั้งค่าทั้งสอง redirect URI ใน Logto Console ของคุณ วิธีค้นหา redirect URI ให้ไปที่หน้า <strong>Logto</strong> &gt; <strong>Settings</strong> ในแผงผู้ดูแล WordPress ของคุณ คุณจะเห็นฟิลด์ <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong></p>
<ol>
<li class="">คัดลอกค่า <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong> แล้ววางลงในฟิลด์ <strong>Redirect URIs</strong> และ <strong>Post sign-out redirect URIs</strong> ใน Logto Console ของคุณ</li>
<li class="">คลิก <strong>บันทึกการเปลี่ยนแปลง (Save changes)</strong> ใน Logto Console</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-website">จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#checkpoint-test-your-website" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบการผสาน Logto ในเว็บไซต์ WordPress ของคุณได้แล้ว:</p>
<ol>
<li class="">เปิดหน้าต่างเบราว์เซอร์แบบไม่ระบุตัวตนหากจำเป็น</li>
<li class="">เข้าเว็บไซต์ WordPress ของคุณแล้วคลิก <strong>เข้าสู่ระบบ (Log in)</strong> หากมี; หรือเข้าหน้าล็อกอินโดยตรง (เช่น <code>https://example.com/wp-login.php</code>)</li>
<li class="">หน้าจะเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">ดำเนินการลงชื่อเข้าใช้หรือสมัครสมาชิกให้เสร็จสิ้น</li>
<li class="">หลังจากยืนยันตัวตนสำเร็จ คุณจะถูกเปลี่ยนเส้นทางกลับไปยังเว็บไซต์ WordPress ของคุณและเข้าสู่ระบบโดยอัตโนมัติ</li>
<li class="">คลิก <strong>ออกจากระบบ (Log out)</strong> เพื่อออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกเปลี่ยนเส้นทางไปยังหน้าออกจากระบบของ Logto แล้วกลับไปยังเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
</ol>
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการตั้งค่าปลั๊กอิน WordPress โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/quick-starts/wordpress-plugin" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>เริ่มต้นใช้งาน WordPress อย่างรวดเร็ว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->WordPress<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Azure AD SSO application<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" title="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-azure-ad-sso-application">ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-1-create-an-azure-ad-sso-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO" translate="no">​</a></h3>
<p>เริ่มต้นการผสานรวม Azure AD SSO โดยการสร้างแอปพลิเคชัน SSO ในฝั่ง Azure AD</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://portal.azure.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Azure portal<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">เลือกบริการ <code>Microsoft Entra ID</code></li>
<li class="">ไปที่ <code>Enterprise applications</code> โดยใช้เมนูด้านข้าง คลิก <code>New application</code> และเลือก <code>Create your own application</code></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_create_application.webp" alt="Azure AD create application">
<ol>
<li class="">กรอกชื่อแอปพลิเคชันและเลือก <code>Integrate any other application you don't find in the gallery (Non-gallery)</code></li>
<li class="">เลือก <code>Setup single sign-on</code> &gt; <code>SAML</code></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_set_up_single_sign_on.webp" alt="Azure AD set up SSO">
<ol>
<li class="">ทำตามคำแนะนำ โดยในขั้นตอนแรก คุณจะต้องกรอกการตั้งค่า SAML พื้นฐานโดยใช้ข้อมูลต่อไปนี้ที่ได้รับจาก Logto</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_sp_config.webp" alt="Azure AD SP config">
<ul>
<li class=""><strong>Audience URI (SP Entity ID)</strong>: ใช้เป็นตัวระบุที่ไม่ซ้ำกันทั่วโลกสำหรับบริการ Logto ของคุณ ทำหน้าที่เป็น EntityId สำหรับ SP ระหว่างคำขอการยืนยันตัวตน (Authentication request) ไปยัง IdP ตัวระบุตัวนี้มีความสำคัญต่อการแลกเปลี่ยนข้อมูล SAML assertion และข้อมูลที่เกี่ยวข้องกับการยืนยันตัวตนอื่น ๆ อย่างปลอดภัยระหว่าง IdP และ Logto</li>
<li class=""><strong>ACS URL</strong>: Assertion Consumer Service (ACS) URL คือที่อยู่ที่ SAML assertion จะถูกส่งมาด้วยคำขอแบบ POST URL นี้ถูกใช้โดย IdP เพื่อส่ง SAML assertion ไปยัง Logto โดยทำหน้าที่เป็น callback URL ที่ Logto คาดว่าจะได้รับและประมวลผล SAML response ที่มีข้อมูลตัวตนของผู้ใช้</li>
</ul>
<p>คลิก <code>Save</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-saml-sso-at-logto">ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-2-configure-saml-sso-at-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto" translate="no">​</a></h3>
<p>เพื่อให้การเชื่อมต่อ SAML SSO ทำงานได้ คุณจะต้องนำข้อมูลเมตาของผู้ให้บริการข้อมูลระบุตัวตน (IdP) ส่งกลับไปยัง Logto มาสลับกลับมาที่ฝั่ง Logto และไปที่แท็บ <code>Connection</code> ของตัวเชื่อมต่อ Azure AD SSO ของคุณ</p>
<p>Logto มีวิธีการตั้งค่าข้อมูลเมตาของ IdP ให้เลือก 3 วิธี วิธีที่ง่ายที่สุดคือการระบุ <code>metadata URL</code> ของแอป Azure AD SSO</p>
<p>คัดลอก <code>App Federation Metadata Url</code> จากส่วน <code>SAML Certificates</code> ของแอป Azure AD SSO ของคุณ แล้ววางลงในช่อง <code>Metadata URL</code> ใน Logto</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_metadata_url.webp" alt="Azure AD Metadata URL">
<p>Logto จะดึงข้อมูลเมตาจาก URL ดังกล่าวและตั้งค่าการเชื่อมต่อ SAML SSO ให้อัตโนมัติ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-user-attributes-mapping">ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-3-configure-user-attributes-mapping" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้" translate="no">​</a></h3>
<p>Logto มีวิธีที่ยืดหยุ่นในการแมปแอตทริบิวต์ของผู้ใช้ที่ได้รับจากผู้ให้บริการข้อมูลระบุตัวตน (IdP) ไปยังแอตทริบิวต์ของผู้ใช้ใน Logto โดย Logto จะซิงค์แอตทริบิวต์ของผู้ใช้ต่อไปนี้จาก IdP โดยอัตโนมัติ:</p>
<ul>
<li class="">id: ตัวระบุที่ไม่ซ้ำของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (<code>nameID</code>) จาก SAML response เป็นรหัส SSO identity ของผู้ใช้</li>
<li class="">email: ที่อยู่อีเมลของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (<code>email</code>) จาก SAML response เป็นอีเมลหลักของผู้ใช้โดยค่าเริ่มต้น</li>
<li class="">name: ชื่อของผู้ใช้</li>
</ul>
<p>คุณสามารถจัดการตรรกะการแมปแอตทริบิวต์ของผู้ใช้ได้ทั้งฝั่ง Azure AD หรือฝั่ง Logto</p>
<ol>
<li class="">
<p>แมปแอตทริบิวต์ของผู้ใช้ AzureAD ไปยังแอตทริบิวต์ของผู้ใช้ Logto ที่ฝั่ง Logto</p>
<p>ไปที่ส่วน <code>Attributes &amp; Claims</code> ของแอป Azure AD SSO ของคุณ</p>
<p>คัดลอกชื่อแอตทริบิวต์ต่อไปนี้ (พร้อมคำนำหน้า namespace) แล้ววางลงในช่องที่เกี่ยวข้องใน Logto</p>
<ul>
<li class=""><code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</code></li>
<li class=""><code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name</code> (คำแนะนำ: อัปเดตการแมปค่านี้เป็น <code>user.displayname</code> เพื่อประสบการณ์ผู้ใช้ที่ดียิ่งขึ้น)</li>
</ul>
</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_default_attribute_mapping.webp" alt="Azure AD default attribute mapping">
<ol>
<li class="">
<p>แมปแอตทริบิวต์ของผู้ใช้ AzureAD ไปยังแอตทริบิวต์ของผู้ใช้ Logto ที่ฝั่ง AzureAD</p>
<p>ไปที่ส่วน <code>Attributes &amp; Claims</code> ของแอป Azure AD SSO ของคุณ</p>
<p>คลิก <code>Edit</code> และอัปเดตช่อง <code>Additional claims</code> ตามการตั้งค่าแอตทริบิวต์ของผู้ใช้ Logto:</p>
<ul>
<li class="">อัปเดตค่าชื่อการอ้างสิทธิ์ตามการตั้งค่าแอตทริบิวต์ของผู้ใช้ Logto</li>
<li class="">ลบคำนำหน้า namespace ออก</li>
<li class="">คลิก <code>Save</code> เพื่อดำเนินการต่อ</li>
</ul>
<p>ควรได้การตั้งค่าดังนี้:</p>
</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_logto_attribute_mapping.webp" alt="Azure AD_Logto attribute mapping">
<p>คุณยังสามารถระบุแอตทริบิวต์ของผู้ใช้เพิ่มเติมที่ฝั่ง Azure AD ได้ Logto จะเก็บบันทึกแอตทริบิวต์ของผู้ใช้ต้นฉบับที่ได้รับจาก IdP ไว้ในฟิลด์ <code>sso_identity</code> ของผู้ใช้</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-assign-users-to-the-azure-ad-sso-application">ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-4-assign-users-to-the-azure-ad-sso-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO" translate="no">​</a></h3>
<p>ไปที่ส่วน <code>Users and groups</code> ของแอปพลิเคชัน Azure AD SSO ของคุณ คลิกที่ <code>Add user/group</code> เพื่อกำหนดผู้ใช้ให้กับแอปพลิเคชัน Azure AD SSO เฉพาะผู้ใช้ที่ถูกกำหนดให้กับแอปพลิเคชัน Azure AD SSO ของคุณเท่านั้นที่จะสามารถยืนยันตัวตนผ่านตัวเชื่อมต่อ Azure AD SSO ได้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_assign_users.webp" alt="Azure AD assign users">
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SAML SSO เป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>โปรดตรวจสอบ <span class="linkWrapper_B4Bt"><a href="https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/add-application-portal-setup-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสารทางการของ Azure AD<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการเชื่อมต่อ Azure AD SSO</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->ปลั๊กอิน WordPress<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>microsoft-entra-id-saml-enterprise-sso</category>
            <category>wordpress-plugin</category>
            <category>php</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง SAML enterprise SSO ด้วย ปลั๊กอิน WordPress]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->SAML enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a></li>
<li class="">มีบัญชี <!-- -->SAML enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->เว็บแบบดั้งเดิม<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->เว็บแบบดั้งเดิม<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->เว็บแบบดั้งเดิม<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->WordPress<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม WordPress กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="install-the-plugin">ติดตั้งปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#install-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" title="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">จากแผงผู้ดูแล WordPress</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">จากการอัปโหลด</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><ol>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong>.</li>
<li class="">ค้นหา "Logto" หรือกรอก <span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">https://wordpress.org/plugins/logto/<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในช่องค้นหา</li>
<li class="">คลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div><div role="tabpanel" class="tabItem_pED3" hidden=""><ol>
<li class="">ดาวน์โหลดปลั๊กอิน Logto WordPress จากลิงก์ใดลิงก์หนึ่งต่อไปนี้:<!-- -->
<ul>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/wordpress/releases" target="_blank" rel="noopener noreferrer" class="link_hf7f">รุ่นล่าสุด (Latest release)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์ที่มีชื่อในรูปแบบ <code>logto-plugin-&lt;version&gt;.zip</code></li>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไดเรกทอรีปลั๊กอิน WordPress (WordPress plugin directory)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์โดยคลิกปุ่ม <strong>ดาวน์โหลด (Download)</strong></li>
</ul>
</li>
<li class="">ดาวน์โหลดไฟล์ ZIP ของปลั๊กอิน</li>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong> ในแผงผู้ดูแล WordPress ของคุณ</li>
<li class="">คลิก <strong>อัปโหลดปลั๊กอิน (Upload Plugin)</strong></li>
<li class="">เลือกไฟล์ ZIP ที่ดาวน์โหลดมาแล้วคลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-the-plugin">ตั้งค่าปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" title="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" translate="no">​</a></h3>
<p>ตอนนี้คุณควรจะเห็นเมนู Logto ในแถบด้านข้างของแผงผู้ดูแล WordPress ของคุณ คลิก <strong>Logto</strong> &gt; <strong>Settings</strong> เพื่อกำหนดค่าปลั๊กอิน</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>คุณควรสร้างแอปพลิเคชัน <strong>เว็บแบบดั้งเดิม (traditional web)</strong> ใน Logto Console ก่อนตั้งค่าปลั๊กอิน หากคุณยังไม่ได้สร้าง โปรดดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/integrate-logto/integrate-logto-into-your-application" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>การผสาน Logto เข้ากับแอปพลิเคชันของคุณ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับข้อมูลเพิ่มเติม</p></div></div></div>
<p>การตั้งค่าขั้นต่ำที่จำเป็นสำหรับเริ่มต้นใช้งานปลั๊กอินคือ:</p>
<ul>
<li class="">Logto endpoint: จุดปลายทางของ Logto tenant ของคุณ</li>
<li class="">App ID: รหัสแอปของแอปพลิเคชัน Logto ของคุณ</li>
<li class="">App secret: หนึ่งในรหัสลับแอปที่ถูกต้องของแอปพลิเคชัน Logto ของคุณ</li>
</ul>
<p>ค่าทั้งหมดนี้สามารถดูได้ที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<p>หลังจากกรอกค่าแล้ว คลิก <strong>บันทึกการเปลี่ยนแปลง (Save Changes)</strong> (เลื่อนลงไปด้านล่างของหน้า หากไม่พบปุ่ม)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">ตั้งค่า redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" title="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" translate="no">​</a></h3>
<p>Redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากยืนยันตัวตนเสร็จ; และ post sign-out redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากออกจากระบบ</p>
<p>นี่คือไดอะแกรมลำดับ (sequence diagram) แบบไม่เป็นทางการเพื่อแสดงขั้นตอนการลงชื่อเข้าใช้:</p>
<!-- -->
<p>นี่คือขั้นตอนการออกจากระบบในไดอะแกรมลำดับแบบไม่เป็นทางการ:</p>
<!-- -->
<p>หากต้องการเรียนรู้เพิ่มเติมว่าทำไมต้องมีการเปลี่ยนเส้นทาง ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p>ในกรณีนี้ คุณต้องตั้งค่าทั้งสอง redirect URI ใน Logto Console ของคุณ วิธีค้นหา redirect URI ให้ไปที่หน้า <strong>Logto</strong> &gt; <strong>Settings</strong> ในแผงผู้ดูแล WordPress ของคุณ คุณจะเห็นฟิลด์ <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong></p>
<ol>
<li class="">คัดลอกค่า <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong> แล้ววางลงในฟิลด์ <strong>Redirect URIs</strong> และ <strong>Post sign-out redirect URIs</strong> ใน Logto Console ของคุณ</li>
<li class="">คลิก <strong>บันทึกการเปลี่ยนแปลง (Save changes)</strong> ใน Logto Console</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-website">จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#checkpoint-test-your-website" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบการผสาน Logto ในเว็บไซต์ WordPress ของคุณได้แล้ว:</p>
<ol>
<li class="">เปิดหน้าต่างเบราว์เซอร์แบบไม่ระบุตัวตนหากจำเป็น</li>
<li class="">เข้าเว็บไซต์ WordPress ของคุณแล้วคลิก <strong>เข้าสู่ระบบ (Log in)</strong> หากมี; หรือเข้าหน้าล็อกอินโดยตรง (เช่น <code>https://example.com/wp-login.php</code>)</li>
<li class="">หน้าจะเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">ดำเนินการลงชื่อเข้าใช้หรือสมัครสมาชิกให้เสร็จสิ้น</li>
<li class="">หลังจากยืนยันตัวตนสำเร็จ คุณจะถูกเปลี่ยนเส้นทางกลับไปยังเว็บไซต์ WordPress ของคุณและเข้าสู่ระบบโดยอัตโนมัติ</li>
<li class="">คลิก <strong>ออกจากระบบ (Log out)</strong> เพื่อออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกเปลี่ยนเส้นทางไปยังหน้าออกจากระบบของ Logto แล้วกลับไปยังเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
</ol>
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการตั้งค่าปลั๊กอิน WordPress โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/quick-starts/wordpress-plugin" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>เริ่มต้นใช้งาน WordPress อย่างรวดเร็ว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ SAML enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ SAML enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ SAML enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->WordPress<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า SAML SSO application on your IdP<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า SAML SSO application on your IdP" title="ลิงก์ตรงไปยัง ตั้งค่า SAML SSO application on your IdP" translate="no">​</a></h2>
<p>ขั้นตอนที่ 1: สร้างแอปพลิเคชัน SAML SSO บน IdP ของคุณ {#step-1-create-a-saml-sso-application-on-your-idp}</p>
<p>เริ่มต้นการผสานรวม SAML Single Sign-On (SSO) โดยการสร้างแอปพลิเคชันในฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP). รับค่าการตั้งค่าต่อไปนี้จาก Logto ซึ่งแสดงถึง Service Provider (SP) ของคุณ:</p>
<ul>
<li class=""><strong>Audience URI (SP Entity ID)</strong>: ใช้เป็นตัวระบุที่ไม่ซ้ำกันทั่วโลกสำหรับบริการ Logto ของคุณ ทำหน้าที่เป็น EntityId สำหรับ SP ในระหว่างคำขอการยืนยันตัวตน (Authentication request) ไปยัง IdP. ตัวระบุตัวนี้มีความสำคัญต่อการแลกเปลี่ยนข้อมูล SAML assertion และข้อมูลที่เกี่ยวข้องกับการยืนยันตัวตนอื่น ๆ อย่างปลอดภัยระหว่าง IdP กับ Logto</li>
<li class=""><strong>ACS URL</strong>: Assertion Consumer Service (ACS) URL คือที่อยู่ที่ SAML assertion จะถูกส่งมาด้วยคำขอแบบ POST. URL นี้ใช้โดย IdP เพื่อส่ง SAML assertion มายัง Logto โดยทำหน้าที่เป็น callback URL ที่ Logto คาดว่าจะได้รับและประมวลผล SAML response ที่มีข้อมูลอัตลักษณ์ของผู้ใช้</li>
</ul>
<p>กรอกค่า Audience URI และ ACS URL ในแอป SAML ของ IdP ของคุณ และดำเนินการต่อเพื่อดึงค่าการตั้งค่าต่อไปนี้จาก IdP ของคุณ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-saml-sso-on-logto">ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-2-configure-saml-sso-on-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto" translate="no">​</a></h3>
<p>เพื่อให้การเชื่อมต่อ SAML SSO ทำงานได้ คุณจะต้องให้ข้อมูลเมทาดาทาของผู้ให้บริการข้อมูลระบุตัวตน (IdP) กับ Logto เมทาดาทา IdP คือเอกสาร <span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/what-is-xml" target="_blank" rel="noopener noreferrer" class="link_hf7f">XML<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ที่มีข้อมูลทั้งหมดที่จำเป็นสำหรับ Logto ในการสร้างความเชื่อถือกับ IdP</p>
<p>ไปที่แท็บ <code>Connection</code> Logto มี 3 วิธีในการกำหนดค่าเมทาดาทา IdP ดังนี้:</p>
<ol>
<li class=""><strong>Metadata URL</strong>: ระบุ URL ของเอกสาร IdP metadata XML Logto จะดึงข้อมูลเมทาดาทาจาก URL และกำหนดค่า SAML SSO ให้อัตโนมัติ</li>
<li class=""><strong>Upload Metadata</strong>: อัปโหลดเอกสาร IdP metadata XML Logto จะวิเคราะห์เอกสาร XML และกำหนดค่า SAML SSO ให้อัตโนมัติ</li>
<li class=""><strong>Manual Configuration</strong>: กำหนดค่าเมทาดาทา IdP ด้วยตนเอง</li>
</ol>
<ul>
<li class="">IdP entity ID: Entity ID ของ IdP</li>
<li class="">Single sign-on URL: URL ของบริการ Single Sign-On ของ IdP</li>
<li class="">Signing certificate: ใบรับรอง x509 ใช้สำหรับตรวจสอบลายเซ็นของ SAML response ที่มาจาก IdP</li>
</ul>
<p>ไม่ว่าคุณจะเลือกวิธีใด Logto จะวิเคราะห์เมทาดาทา IdP และกำหนดค่า SAML SSO ให้สอดคล้องกัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-user-attributes-mapping">ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-3-configure-user-attributes-mapping" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้" translate="no">​</a></h3>
<p>แอตทริบิวต์ของผู้ใช้ที่ส่งกลับมาจาก IdP อาจแตกต่างกันไปขึ้นอยู่กับการตั้งค่าของ IdP Logto มีวิธีที่ยืดหยุ่นในการแมปแอตทริบิวต์ของผู้ใช้ที่ได้รับจาก IdP ไปยังแอตทริบิวต์ของผู้ใช้ใน Logto คุณสามารถกำหนดค่าการแมปแอตทริบิวต์ของผู้ใช้ได้ในแท็บประสบการณ์การผสานรวม SAML SSO</p>
<ul>
<li class="">id: ตัวระบุเฉพาะของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (claim) <code>nameId</code> จาก SAML response เป็นรหัส SSO identity ของผู้ใช้</li>
<li class="">email: ที่อยู่อีเมลของผู้ใช้</li>
<li class="">name: ชื่อของผู้ใช้</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step4-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step4-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO ให้เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SAML SSO เป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->SAML enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->ปลั๊กอิน WordPress<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->SAML enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>saml-enterprise-sso</category>
            <category>wordpress-plugin</category>
            <category>php</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Microsoft Entra ID SAML enterprise SSO ด้วย Vue]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a></li>
<li class="">มีบัญชี <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vue<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vue กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">Logto Vue SDK ถูกสร้างขึ้นด้วย composition API และใช้ composables ดังนั้นจึงรองรับเฉพาะ Vue 3 เท่านั้น</li>
<li class="">วิดีโอแนะนำมีให้รับชมบน <span class="linkWrapper_B4Bt"><a href="https://youtu.be/cAfsQrsGQqA" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">โปรเจกต์ตัวอย่างฉบับเต็มสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/vue-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>createLogto</code> เพื่อติดตั้งปลั๊กอิน Logto:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">main.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> LogtoConfig </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createApp </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> App </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'./App.vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// กำหนดค่าการเชื่อมต่อ Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> LogtoConfig </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> app </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">App</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">mount</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#app'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีสิ่งที่ต้องทำหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการให้ถูกต้องกัน</p>
<p>ก่อนอื่น สร้างหน้าคอลแบ็ก (callback) ดังนี้:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/CallbackView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> useHandleSignInCallback </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> router </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@/router'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขณะกำลังดำเนินการ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">isLoading</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>แทรกโค้ดด้านล่างในเส้นทาง <code>/callback</code> ของคุณ ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">router/index.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ vue-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> router </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createRouter</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  routes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      path</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      component</span><span class="token operator">:</span><span class="token plain"> CallbackView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี composable สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ที่ช่วยให้คุณจัดการโฟลว์การยืนยันตัวตนได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/HomeView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ดึงฟังก์ชัน signIn, signOut และตัวแปร isAuthenticated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">!isAuthenticated</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignIn</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ลงชื่อเข้าใช้</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-else</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignOut</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ออกจากระบบ</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vue<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Azure AD SSO application<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" title="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-azure-ad-sso-application">ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#step-1-create-an-azure-ad-sso-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO" translate="no">​</a></h3>
<p>เริ่มต้นการผสานรวม Azure AD SSO โดยการสร้างแอปพลิเคชัน SSO ในฝั่ง Azure AD</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://portal.azure.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Azure portal<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">เลือกบริการ <code>Microsoft Entra ID</code></li>
<li class="">ไปที่ <code>Enterprise applications</code> โดยใช้เมนูด้านข้าง คลิก <code>New application</code> และเลือก <code>Create your own application</code></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_create_application.webp" alt="Azure AD create application">
<ol>
<li class="">กรอกชื่อแอปพลิเคชันและเลือก <code>Integrate any other application you don't find in the gallery (Non-gallery)</code></li>
<li class="">เลือก <code>Setup single sign-on</code> &gt; <code>SAML</code></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_set_up_single_sign_on.webp" alt="Azure AD set up SSO">
<ol>
<li class="">ทำตามคำแนะนำ โดยในขั้นตอนแรก คุณจะต้องกรอกการตั้งค่า SAML พื้นฐานโดยใช้ข้อมูลต่อไปนี้ที่ได้รับจาก Logto</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_sp_config.webp" alt="Azure AD SP config">
<ul>
<li class=""><strong>Audience URI (SP Entity ID)</strong>: ใช้เป็นตัวระบุที่ไม่ซ้ำกันทั่วโลกสำหรับบริการ Logto ของคุณ ทำหน้าที่เป็น EntityId สำหรับ SP ระหว่างคำขอการยืนยันตัวตน (Authentication request) ไปยัง IdP ตัวระบุตัวนี้มีความสำคัญต่อการแลกเปลี่ยนข้อมูล SAML assertion และข้อมูลที่เกี่ยวข้องกับการยืนยันตัวตนอื่น ๆ อย่างปลอดภัยระหว่าง IdP และ Logto</li>
<li class=""><strong>ACS URL</strong>: Assertion Consumer Service (ACS) URL คือที่อยู่ที่ SAML assertion จะถูกส่งมาด้วยคำขอแบบ POST URL นี้ถูกใช้โดย IdP เพื่อส่ง SAML assertion ไปยัง Logto โดยทำหน้าที่เป็น callback URL ที่ Logto คาดว่าจะได้รับและประมวลผล SAML response ที่มีข้อมูลตัวตนของผู้ใช้</li>
</ul>
<p>คลิก <code>Save</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-saml-sso-at-logto">ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#step-2-configure-saml-sso-at-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto" translate="no">​</a></h3>
<p>เพื่อให้การเชื่อมต่อ SAML SSO ทำงานได้ คุณจะต้องนำข้อมูลเมตาของผู้ให้บริการข้อมูลระบุตัวตน (IdP) ส่งกลับไปยัง Logto มาสลับกลับมาที่ฝั่ง Logto และไปที่แท็บ <code>Connection</code> ของตัวเชื่อมต่อ Azure AD SSO ของคุณ</p>
<p>Logto มีวิธีการตั้งค่าข้อมูลเมตาของ IdP ให้เลือก 3 วิธี วิธีที่ง่ายที่สุดคือการระบุ <code>metadata URL</code> ของแอป Azure AD SSO</p>
<p>คัดลอก <code>App Federation Metadata Url</code> จากส่วน <code>SAML Certificates</code> ของแอป Azure AD SSO ของคุณ แล้ววางลงในช่อง <code>Metadata URL</code> ใน Logto</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_metadata_url.webp" alt="Azure AD Metadata URL">
<p>Logto จะดึงข้อมูลเมตาจาก URL ดังกล่าวและตั้งค่าการเชื่อมต่อ SAML SSO ให้อัตโนมัติ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-user-attributes-mapping">ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#step-3-configure-user-attributes-mapping" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้" translate="no">​</a></h3>
<p>Logto มีวิธีที่ยืดหยุ่นในการแมปแอตทริบิวต์ของผู้ใช้ที่ได้รับจากผู้ให้บริการข้อมูลระบุตัวตน (IdP) ไปยังแอตทริบิวต์ของผู้ใช้ใน Logto โดย Logto จะซิงค์แอตทริบิวต์ของผู้ใช้ต่อไปนี้จาก IdP โดยอัตโนมัติ:</p>
<ul>
<li class="">id: ตัวระบุที่ไม่ซ้ำของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (<code>nameID</code>) จาก SAML response เป็นรหัส SSO identity ของผู้ใช้</li>
<li class="">email: ที่อยู่อีเมลของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (<code>email</code>) จาก SAML response เป็นอีเมลหลักของผู้ใช้โดยค่าเริ่มต้น</li>
<li class="">name: ชื่อของผู้ใช้</li>
</ul>
<p>คุณสามารถจัดการตรรกะการแมปแอตทริบิวต์ของผู้ใช้ได้ทั้งฝั่ง Azure AD หรือฝั่ง Logto</p>
<ol>
<li class="">
<p>แมปแอตทริบิวต์ของผู้ใช้ AzureAD ไปยังแอตทริบิวต์ของผู้ใช้ Logto ที่ฝั่ง Logto</p>
<p>ไปที่ส่วน <code>Attributes &amp; Claims</code> ของแอป Azure AD SSO ของคุณ</p>
<p>คัดลอกชื่อแอตทริบิวต์ต่อไปนี้ (พร้อมคำนำหน้า namespace) แล้ววางลงในช่องที่เกี่ยวข้องใน Logto</p>
<ul>
<li class=""><code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</code></li>
<li class=""><code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name</code> (คำแนะนำ: อัปเดตการแมปค่านี้เป็น <code>user.displayname</code> เพื่อประสบการณ์ผู้ใช้ที่ดียิ่งขึ้น)</li>
</ul>
</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_default_attribute_mapping.webp" alt="Azure AD default attribute mapping">
<ol>
<li class="">
<p>แมปแอตทริบิวต์ของผู้ใช้ AzureAD ไปยังแอตทริบิวต์ของผู้ใช้ Logto ที่ฝั่ง AzureAD</p>
<p>ไปที่ส่วน <code>Attributes &amp; Claims</code> ของแอป Azure AD SSO ของคุณ</p>
<p>คลิก <code>Edit</code> และอัปเดตช่อง <code>Additional claims</code> ตามการตั้งค่าแอตทริบิวต์ของผู้ใช้ Logto:</p>
<ul>
<li class="">อัปเดตค่าชื่อการอ้างสิทธิ์ตามการตั้งค่าแอตทริบิวต์ของผู้ใช้ Logto</li>
<li class="">ลบคำนำหน้า namespace ออก</li>
<li class="">คลิก <code>Save</code> เพื่อดำเนินการต่อ</li>
</ul>
<p>ควรได้การตั้งค่าดังนี้:</p>
</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_logto_attribute_mapping.webp" alt="Azure AD_Logto attribute mapping">
<p>คุณยังสามารถระบุแอตทริบิวต์ของผู้ใช้เพิ่มเติมที่ฝั่ง Azure AD ได้ Logto จะเก็บบันทึกแอตทริบิวต์ของผู้ใช้ต้นฉบับที่ได้รับจาก IdP ไว้ในฟิลด์ <code>sso_identity</code> ของผู้ใช้</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-assign-users-to-the-azure-ad-sso-application">ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#step-4-assign-users-to-the-azure-ad-sso-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO" translate="no">​</a></h3>
<p>ไปที่ส่วน <code>Users and groups</code> ของแอปพลิเคชัน Azure AD SSO ของคุณ คลิกที่ <code>Add user/group</code> เพื่อกำหนดผู้ใช้ให้กับแอปพลิเคชัน Azure AD SSO เฉพาะผู้ใช้ที่ถูกกำหนดให้กับแอปพลิเคชัน Azure AD SSO ของคุณเท่านั้นที่จะสามารถยืนยันตัวตนผ่านตัวเชื่อมต่อ Azure AD SSO ได้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_assign_users.webp" alt="Azure AD assign users">
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SAML SSO เป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>โปรดตรวจสอบ <span class="linkWrapper_B4Bt"><a href="https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/add-application-portal-setup-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสารทางการของ Azure AD<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการเชื่อมต่อ Azure AD SSO</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vue<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vue-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>microsoft-entra-id-saml-enterprise-sso</category>
            <category>vue</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Google Workspace enterprise SSO ด้วย ปลั๊กอิน WordPress]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Google Workspace enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a></li>
<li class="">มีบัญชี <!-- -->Google Workspace enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->เว็บแบบดั้งเดิม<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->เว็บแบบดั้งเดิม<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->เว็บแบบดั้งเดิม<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->WordPress<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม WordPress กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="install-the-plugin">ติดตั้งปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#install-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" title="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">จากแผงผู้ดูแล WordPress</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">จากการอัปโหลด</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><ol>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong>.</li>
<li class="">ค้นหา "Logto" หรือกรอก <span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">https://wordpress.org/plugins/logto/<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในช่องค้นหา</li>
<li class="">คลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div><div role="tabpanel" class="tabItem_pED3" hidden=""><ol>
<li class="">ดาวน์โหลดปลั๊กอิน Logto WordPress จากลิงก์ใดลิงก์หนึ่งต่อไปนี้:<!-- -->
<ul>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/wordpress/releases" target="_blank" rel="noopener noreferrer" class="link_hf7f">รุ่นล่าสุด (Latest release)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์ที่มีชื่อในรูปแบบ <code>logto-plugin-&lt;version&gt;.zip</code></li>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไดเรกทอรีปลั๊กอิน WordPress (WordPress plugin directory)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์โดยคลิกปุ่ม <strong>ดาวน์โหลด (Download)</strong></li>
</ul>
</li>
<li class="">ดาวน์โหลดไฟล์ ZIP ของปลั๊กอิน</li>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong> ในแผงผู้ดูแล WordPress ของคุณ</li>
<li class="">คลิก <strong>อัปโหลดปลั๊กอิน (Upload Plugin)</strong></li>
<li class="">เลือกไฟล์ ZIP ที่ดาวน์โหลดมาแล้วคลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-the-plugin">ตั้งค่าปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" title="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" translate="no">​</a></h3>
<p>ตอนนี้คุณควรจะเห็นเมนู Logto ในแถบด้านข้างของแผงผู้ดูแล WordPress ของคุณ คลิก <strong>Logto</strong> &gt; <strong>Settings</strong> เพื่อกำหนดค่าปลั๊กอิน</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>คุณควรสร้างแอปพลิเคชัน <strong>เว็บแบบดั้งเดิม (traditional web)</strong> ใน Logto Console ก่อนตั้งค่าปลั๊กอิน หากคุณยังไม่ได้สร้าง โปรดดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/integrate-logto/integrate-logto-into-your-application" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>การผสาน Logto เข้ากับแอปพลิเคชันของคุณ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับข้อมูลเพิ่มเติม</p></div></div></div>
<p>การตั้งค่าขั้นต่ำที่จำเป็นสำหรับเริ่มต้นใช้งานปลั๊กอินคือ:</p>
<ul>
<li class="">Logto endpoint: จุดปลายทางของ Logto tenant ของคุณ</li>
<li class="">App ID: รหัสแอปของแอปพลิเคชัน Logto ของคุณ</li>
<li class="">App secret: หนึ่งในรหัสลับแอปที่ถูกต้องของแอปพลิเคชัน Logto ของคุณ</li>
</ul>
<p>ค่าทั้งหมดนี้สามารถดูได้ที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<p>หลังจากกรอกค่าแล้ว คลิก <strong>บันทึกการเปลี่ยนแปลง (Save Changes)</strong> (เลื่อนลงไปด้านล่างของหน้า หากไม่พบปุ่ม)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">ตั้งค่า redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" title="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" translate="no">​</a></h3>
<p>Redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากยืนยันตัวตนเสร็จ; และ post sign-out redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากออกจากระบบ</p>
<p>นี่คือไดอะแกรมลำดับ (sequence diagram) แบบไม่เป็นทางการเพื่อแสดงขั้นตอนการลงชื่อเข้าใช้:</p>
<!-- -->
<p>นี่คือขั้นตอนการออกจากระบบในไดอะแกรมลำดับแบบไม่เป็นทางการ:</p>
<!-- -->
<p>หากต้องการเรียนรู้เพิ่มเติมว่าทำไมต้องมีการเปลี่ยนเส้นทาง ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p>ในกรณีนี้ คุณต้องตั้งค่าทั้งสอง redirect URI ใน Logto Console ของคุณ วิธีค้นหา redirect URI ให้ไปที่หน้า <strong>Logto</strong> &gt; <strong>Settings</strong> ในแผงผู้ดูแล WordPress ของคุณ คุณจะเห็นฟิลด์ <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong></p>
<ol>
<li class="">คัดลอกค่า <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong> แล้ววางลงในฟิลด์ <strong>Redirect URIs</strong> และ <strong>Post sign-out redirect URIs</strong> ใน Logto Console ของคุณ</li>
<li class="">คลิก <strong>บันทึกการเปลี่ยนแปลง (Save changes)</strong> ใน Logto Console</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-website">จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#checkpoint-test-your-website" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบการผสาน Logto ในเว็บไซต์ WordPress ของคุณได้แล้ว:</p>
<ol>
<li class="">เปิดหน้าต่างเบราว์เซอร์แบบไม่ระบุตัวตนหากจำเป็น</li>
<li class="">เข้าเว็บไซต์ WordPress ของคุณแล้วคลิก <strong>เข้าสู่ระบบ (Log in)</strong> หากมี; หรือเข้าหน้าล็อกอินโดยตรง (เช่น <code>https://example.com/wp-login.php</code>)</li>
<li class="">หน้าจะเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">ดำเนินการลงชื่อเข้าใช้หรือสมัครสมาชิกให้เสร็จสิ้น</li>
<li class="">หลังจากยืนยันตัวตนสำเร็จ คุณจะถูกเปลี่ยนเส้นทางกลับไปยังเว็บไซต์ WordPress ของคุณและเข้าสู่ระบบโดยอัตโนมัติ</li>
<li class="">คลิก <strong>ออกจากระบบ (Log out)</strong> เพื่อออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกเปลี่ยนเส้นทางไปยังหน้าออกจากระบบของ Logto แล้วกลับไปยังเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
</ol>
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการตั้งค่าปลั๊กอิน WordPress โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/quick-starts/wordpress-plugin" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>เริ่มต้นใช้งาน WordPress อย่างรวดเร็ว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->WordPress<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Google Cloud Platform<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Google Cloud Platform" title="ลิงก์ตรงไปยัง ตั้งค่า Google Cloud Platform" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-a-new-project-on-google-cloud-platform">ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-1-create-a-new-project-on-google-cloud-platform" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform" translate="no">​</a></h3>
<p>ก่อนที่คุณจะสามารถใช้ Google Workspace เป็นผู้ให้บริการการยืนยันตัวตน (authentication provider) ได้ คุณต้องตั้งค่าโปรเจกต์ใน <span class="linkWrapper_B4Bt"><a href="https://console.developers.google.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google API Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อขอรับข้อมูลประจำตัว OAuth 2.0 หากคุณมีโปรเจกต์อยู่แล้ว สามารถข้ามขั้นตอนนี้ได้ หากยังไม่มี ให้สร้างโปรเจกต์ใหม่ภายใต้องค์กร Google ของคุณ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-config-the-consent-screen-for-your-application">ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-2-config-the-consent-screen-for-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>เพื่อสร้างข้อมูลรับรอง OIDC ใหม่ คุณต้องกำหนดค่าหน้าขอความยินยอม (Consent Screen) สำหรับแอปพลิเคชันของคุณ</p>
<ol>
<li class="">ไปที่หน้า <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/credentials/consent" target="_blank" rel="noopener noreferrer" class="link_hf7f">OAuth consent screen<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และเลือกประเภทผู้ใช้ <code>Internal</code> การตั้งค่านี้จะทำให้แอป OAuth สามารถใช้งานได้เฉพาะผู้ใช้ภายในองค์กรของคุณเท่านั้น</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_user_type.webp" alt="ประเภทผู้ใช้ในหน้าขอความยินยอมของ Google Workspace">
<ol start="2">
<li class="">กรอกการตั้งค่า <code>Consent Screen</code> ตามคำแนะนำบนหน้า คุณต้องระบุข้อมูลขั้นต่ำดังต่อไปนี้:</li>
</ol>
<ul>
<li class=""><strong>ชื่อแอปพลิเคชัน (Application name)</strong>: ชื่อของแอปพลิเคชันของคุณ ซึ่งจะแสดงบนหน้าขอความยินยอม</li>
<li class=""><strong>อีเมลสำหรับติดต่อ (Support email)</strong>: อีเมลสำหรับติดต่อของแอปพลิเคชัน ซึ่งจะแสดงบนหน้าขอความยินยอม</li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_settings.webp" alt="การตั้งค่าหน้าขอความยินยอมของ Google Workspace">
<ol start="3">
<li class="">กำหนด <code>ขอบเขต (Scopes)</code> สำหรับแอปพลิเคชันของคุณ เพื่อดึงข้อมูลตัวตนและอีเมลของผู้ใช้อย่างถูกต้องจาก IdP ตัวเชื่อมต่อ SSO ของ Logto จำเป็นต้องขอขอบเขตต่อไปนี้จาก IdP:</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_scopes.webp" alt="ขอบเขตในหน้าขอความยินยอมของ Google Workspace">
<ul>
<li class=""><strong>openid</strong>: ขอบเขตนี้จำเป็นสำหรับการยืนยันตัวตน OIDC ใช้สำหรับดึงโทเค็น ID (ID token) และเข้าถึง endpoint userInfo ของ IdP</li>
<li class=""><strong>profile</strong>: ขอบเขตนี้จำเป็นสำหรับการเข้าถึงข้อมูลโปรไฟล์พื้นฐานของผู้ใช้</li>
<li class=""><strong>email</strong>: ขอบเขตนี้จำเป็นสำหรับการเข้าถึงที่อยู่อีเมลของผู้ใช้</li>
</ul>
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าหน้าขอความยินยอม</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-create-a-new-oauth-credential">ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-3-create-a-new-oauth-credential" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่" translate="no">​</a></h3>
<p>ไปที่หน้า <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener noreferrer" class="link_hf7f">Credentials<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม <code>Create Credentials</code> จากนั้นเลือกตัวเลือก <code>OAuth client ID</code> จากเมนูดรอปดาวน์เพื่อสร้าง OAuth credential ใหม่สำหรับแอปพลิเคชันของคุณ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_create_credentials.webp" alt="Google Workspace create credentials">
<p>ดำเนินการตั้งค่า OAuth credential ต่อโดยกรอกข้อมูลดังต่อไปนี้:</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_credentials_config.webp" alt="Google Workspace credentials config">
<ol>
<li class="">เลือก <code>Web application</code> เป็นประเภทของแอปพลิเคชัน</li>
<li class="">กรอก <code>Name</code> ของแอปพลิเคชันลูกข่ายของคุณ เช่น <code>Logto SSO Connector</code> เพื่อช่วยให้คุณระบุ credential นี้ได้ในอนาคต</li>
<li class="">กรอก <code>Authorized redirect URIs</code> ด้วย Logto callback URI นี่คือ URI ที่ Google จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตนสำเร็จ หลังจากผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI นี้พร้อมกับ authorization code Logto จะดำเนินการยืนยันตัวตนให้สมบูรณ์โดยอิงจาก authorization code ที่ได้รับจาก URI นี้</li>
<li class="">กรอก <code>Authorized JavaScript origins</code> ด้วย origin ของ Logto callback URI เพื่อให้แน่ใจว่าเฉพาะแอป Logto ของคุณเท่านั้นที่สามารถส่งคำขอไปยัง Google OAuth server ได้</li>
<li class="">คลิกปุ่ม <code>Create</code> เพื่อสร้าง OAuth credential</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-4-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์" translate="no">​</a></h3>
<p>หลังจากสร้างข้อมูลประจำตัว OAuth สำเร็จแล้ว คุณจะได้รับหน้าต่างแจ้งเตือนที่แสดง client ID และ client secret</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_create_credentials.webp" alt="Google Workspace create credentials">
<p>คัดลอก <code>Client ID</code> และ <code>Client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ขณะนี้คุณได้ตั้งค่าตัวเชื่อมต่อ Google Workspace SSO บน Logto สำเร็จแล้ว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-additional-scopes-optional">ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-5-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Google Workspace ของพวกเขาได้ การร้องขอสิทธิ์ของ Google จำเป็นต้องมีการตั้งค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Google Cloud Console:</strong></p>
<ol>
<li class="">ไปที่ <strong>APIs &amp; Services &gt; OAuth consent screen &gt; Scopes</strong></li>
<li class="">คลิก <strong>Add or Remove Scopes</strong> และเลือกเฉพาะขอบเขตที่แอปของคุณต้องการ:<!-- -->
<ul>
<li class="">การยืนยันตัวตน (Authentication) (จำเป็น):<!-- -->
<ul>
<li class=""><code>https://www.googleapis.com/auth/userinfo.email</code></li>
<li class=""><code>https://www.googleapis.com/auth/userinfo.profile</code></li>
<li class=""><code>openid</code></li>
</ul>
</li>
<li class="">การเข้าถึง API (ไม่บังคับ): เพิ่มขอบเขตเพิ่มเติมที่แอปของคุณต้องการ (เช่น Drive, Calendar, YouTube) ค้นหาบริการที่มีได้ใน <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/library" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google API Library<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> หากแอปของคุณต้องการเข้าถึง Google API เกินกว่าสิทธิ์พื้นฐาน ให้เปิดใช้งาน API เฉพาะที่แอปของคุณจะใช้ก่อน (เช่น Google Drive API, Gmail API, Calendar API) ใน Google API Library</li>
</ul>
</li>
<li class="">คลิก <strong>Update</strong> เพื่อยืนยันการเลือก</li>
<li class="">คลิก <strong>Save and Continue</strong> เพื่อบันทึกการเปลี่ยนแปลง</li>
</ol>
<p><strong>ในตัวเชื่อมต่อ Google Workspace ของ Logto:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลเอกลักษณ์ผู้ใช้พื้นฐาน คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Google โดยใช้ URL ขอบเขตแบบเต็ม ตัวอย่างเช่น: <code>https://www.googleapis.com/auth/calendar.readonly</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Google API และดำเนินการต่าง ๆ โปรดเปิดใช้งาน <strong>Store tokens for persistent API access</strong> ในตัวเชื่อมต่อ Google ของ Logto ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-store-tokens-to-access-google-apis-optional">ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-6-store-tokens-to-access-google-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/library" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google APIs<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่ต้องการในหน้าการตั้งค่าความยินยอม OAuth ของ Google Cloud Console และในตัวเชื่อมต่อ Google ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Google ของ Logto Logto จะจัดเก็บโทเค็นการเข้าถึง Google และโทเค็นรีเฟรช Google ไว้อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่าจะได้รับโทเค็นรีเฟรช ให้ตั้งค่าตัวเชื่อมต่อ Google ของ Logto ให้เปิดใช้งาน <strong>Offline Access</strong></li>
</ol>
<div class="theme-admonition theme-admonition-warning admonition_Gfwi alert alert--warning"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">คำเตือน<!-- -->:</span><p>คุณไม่จำเป็นต้องเพิ่ม <code>offline_access</code> ในช่อง <code>Scope</code> ของ Logto — การเพิ่มอาจทำให้เกิดข้อผิดพลาด Google จะใช้ <code>access_type=offline</code> โดยอัตโนมัติเมื่อเปิดใช้งาน offline access</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-7-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-7-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับข้อมูลเพิ่มเติมเกี่ยวกับตัวเชื่อมต่อ Google Workspace SSO โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developers.google.com/identity/openid-connect/openid-connect" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google OpenID Connector<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Google Workspace enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->ปลั๊กอิน WordPress<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Google Workspace enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>google-workspace-enterprise-sso</category>
            <category>wordpress-plugin</category>
            <category>php</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง OIDC enterprise SSO ด้วย ปลั๊กอิน WordPress]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->OIDC enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a></li>
<li class="">มีบัญชี <!-- -->OIDC enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->เว็บแบบดั้งเดิม<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->เว็บแบบดั้งเดิม<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->เว็บแบบดั้งเดิม<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->WordPress<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม WordPress กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="install-the-plugin">ติดตั้งปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#install-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" title="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">จากแผงผู้ดูแล WordPress</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">จากการอัปโหลด</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><ol>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong>.</li>
<li class="">ค้นหา "Logto" หรือกรอก <span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">https://wordpress.org/plugins/logto/<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในช่องค้นหา</li>
<li class="">คลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div><div role="tabpanel" class="tabItem_pED3" hidden=""><ol>
<li class="">ดาวน์โหลดปลั๊กอิน Logto WordPress จากลิงก์ใดลิงก์หนึ่งต่อไปนี้:<!-- -->
<ul>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/wordpress/releases" target="_blank" rel="noopener noreferrer" class="link_hf7f">รุ่นล่าสุด (Latest release)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์ที่มีชื่อในรูปแบบ <code>logto-plugin-&lt;version&gt;.zip</code></li>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไดเรกทอรีปลั๊กอิน WordPress (WordPress plugin directory)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์โดยคลิกปุ่ม <strong>ดาวน์โหลด (Download)</strong></li>
</ul>
</li>
<li class="">ดาวน์โหลดไฟล์ ZIP ของปลั๊กอิน</li>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong> ในแผงผู้ดูแล WordPress ของคุณ</li>
<li class="">คลิก <strong>อัปโหลดปลั๊กอิน (Upload Plugin)</strong></li>
<li class="">เลือกไฟล์ ZIP ที่ดาวน์โหลดมาแล้วคลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-the-plugin">ตั้งค่าปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" title="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" translate="no">​</a></h3>
<p>ตอนนี้คุณควรจะเห็นเมนู Logto ในแถบด้านข้างของแผงผู้ดูแล WordPress ของคุณ คลิก <strong>Logto</strong> &gt; <strong>Settings</strong> เพื่อกำหนดค่าปลั๊กอิน</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>คุณควรสร้างแอปพลิเคชัน <strong>เว็บแบบดั้งเดิม (traditional web)</strong> ใน Logto Console ก่อนตั้งค่าปลั๊กอิน หากคุณยังไม่ได้สร้าง โปรดดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/integrate-logto/integrate-logto-into-your-application" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>การผสาน Logto เข้ากับแอปพลิเคชันของคุณ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับข้อมูลเพิ่มเติม</p></div></div></div>
<p>การตั้งค่าขั้นต่ำที่จำเป็นสำหรับเริ่มต้นใช้งานปลั๊กอินคือ:</p>
<ul>
<li class="">Logto endpoint: จุดปลายทางของ Logto tenant ของคุณ</li>
<li class="">App ID: รหัสแอปของแอปพลิเคชัน Logto ของคุณ</li>
<li class="">App secret: หนึ่งในรหัสลับแอปที่ถูกต้องของแอปพลิเคชัน Logto ของคุณ</li>
</ul>
<p>ค่าทั้งหมดนี้สามารถดูได้ที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<p>หลังจากกรอกค่าแล้ว คลิก <strong>บันทึกการเปลี่ยนแปลง (Save Changes)</strong> (เลื่อนลงไปด้านล่างของหน้า หากไม่พบปุ่ม)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">ตั้งค่า redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" title="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" translate="no">​</a></h3>
<p>Redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากยืนยันตัวตนเสร็จ; และ post sign-out redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากออกจากระบบ</p>
<p>นี่คือไดอะแกรมลำดับ (sequence diagram) แบบไม่เป็นทางการเพื่อแสดงขั้นตอนการลงชื่อเข้าใช้:</p>
<!-- -->
<p>นี่คือขั้นตอนการออกจากระบบในไดอะแกรมลำดับแบบไม่เป็นทางการ:</p>
<!-- -->
<p>หากต้องการเรียนรู้เพิ่มเติมว่าทำไมต้องมีการเปลี่ยนเส้นทาง ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p>ในกรณีนี้ คุณต้องตั้งค่าทั้งสอง redirect URI ใน Logto Console ของคุณ วิธีค้นหา redirect URI ให้ไปที่หน้า <strong>Logto</strong> &gt; <strong>Settings</strong> ในแผงผู้ดูแล WordPress ของคุณ คุณจะเห็นฟิลด์ <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong></p>
<ol>
<li class="">คัดลอกค่า <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong> แล้ววางลงในฟิลด์ <strong>Redirect URIs</strong> และ <strong>Post sign-out redirect URIs</strong> ใน Logto Console ของคุณ</li>
<li class="">คลิก <strong>บันทึกการเปลี่ยนแปลง (Save changes)</strong> ใน Logto Console</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-website">จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#checkpoint-test-your-website" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบการผสาน Logto ในเว็บไซต์ WordPress ของคุณได้แล้ว:</p>
<ol>
<li class="">เปิดหน้าต่างเบราว์เซอร์แบบไม่ระบุตัวตนหากจำเป็น</li>
<li class="">เข้าเว็บไซต์ WordPress ของคุณแล้วคลิก <strong>เข้าสู่ระบบ (Log in)</strong> หากมี; หรือเข้าหน้าล็อกอินโดยตรง (เช่น <code>https://example.com/wp-login.php</code>)</li>
<li class="">หน้าจะเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">ดำเนินการลงชื่อเข้าใช้หรือสมัครสมาชิกให้เสร็จสิ้น</li>
<li class="">หลังจากยืนยันตัวตนสำเร็จ คุณจะถูกเปลี่ยนเส้นทางกลับไปยังเว็บไซต์ WordPress ของคุณและเข้าสู่ระบบโดยอัตโนมัติ</li>
<li class="">คลิก <strong>ออกจากระบบ (Log out)</strong> เพื่อออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกเปลี่ยนเส้นทางไปยังหน้าออกจากระบบของ Logto แล้วกลับไปยังเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
</ol>
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการตั้งค่าปลั๊กอิน WordPress โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/quick-starts/wordpress-plugin" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>เริ่มต้นใช้งาน WordPress อย่างรวดเร็ว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->WordPress<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on your IdP<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on your IdP" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on your IdP" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-your-idp">ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-1-create-an-oidc-application-on-your-idp" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ" translate="no">​</a></h3>
<p>เริ่มต้นการผสานรวม OIDC SSO โดยการสร้างแอปพลิเคชันฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP) คุณจะต้องใช้การตั้งค่าต่อไปนี้จากเซิร์ฟเวอร์ Logto</p>
<ul>
<li class=""><strong>Callback URI</strong>: Logto Callback URI หรือที่รู้จักกันในชื่อ Redirect URI หรือ Reply URL คือจุดปลายทาง (endpoint) หรือ URL เฉพาะที่ IdP ใช้สำหรับเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตนสำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จแล้ว IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมายัง URI ที่กำหนดนี้พร้อมกับ authorization code จากนั้น Logto จะดำเนินการยืนยันตัวตนให้สมบูรณ์โดยอิงจาก authorization code ที่ได้รับจาก URI นี้</li>
</ul>
<p>กรอก Logto Callback URI ลงในฟอร์มตั้งค่าแอป OIDC ของ IdP ของคุณ แล้วดำเนินการสร้างแอปพลิเคชันต่อไป (IdP OIDC ส่วนใหญ่มีประเภทแอปพลิเคชันให้เลือกหลากหลายรูปแบบ หากต้องการสร้างตัวเชื่อมต่อ SSO แบบเว็บบน Logto โปรดเลือกประเภท <code>Web Application</code>)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-oidc-sso-on-logto">ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-2-configure-oidc-sso-on-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC บนฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP) สำเร็จแล้ว คุณจะต้องนำค่าการตั้งค่าของ IdP กลับมากรอกใน Logto โดยไปที่แท็บ <code>Connection</code> และกรอกค่าต่อไปนี้:</p>
<ul>
<li class=""><strong>Client ID</strong>: ตัวระบุที่ไม่ซ้ำกันซึ่ง IdP กำหนดให้กับแอปพลิเคชัน OIDC ของคุณ ตัวระบุตัวนี้ใช้โดย Logto เพื่อระบุและยืนยันตัวตนของแอปพลิเคชันระหว่างกระบวนการ OIDC</li>
<li class=""><strong>Client Secret</strong>: รหัสลับที่ใช้ร่วมกันระหว่าง Logto กับ IdP รหัสลับนี้ใช้เพื่อยืนยันตัวตนของแอปพลิเคชัน OIDC และรักษาความปลอดภัยของการสื่อสารระหว่าง Logto กับ IdP</li>
<li class=""><strong>ผู้ออก (Issuer)</strong>: URL ของผู้ออก ซึ่งเป็นตัวระบุที่ไม่ซ้ำกันสำหรับ IdP โดยระบุที่ตั้งของผู้ให้บริการข้อมูลระบุตัวตน OIDC ถือเป็นส่วนสำคัญของการตั้งค่า OIDC เพราะช่วยให้ Logto ค้นหา endpoint ที่จำเป็นได้
เพื่อให้ง่ายต่อการตั้งค่า Logto จะดึง endpoint และการตั้งค่าที่จำเป็นของ OIDC มาให้อัตโนมัติ โดยใช้ผู้ออก (issuer) ที่คุณระบุและเรียกไปยัง OIDC discover endpoint ของ IdP ดังนั้นจึงจำเป็นต้องตรวจสอบให้แน่ใจว่า endpoint ของผู้ออกถูกต้องและตั้งค่าอย่างแม่นยำ เพื่อให้ Logto สามารถดึงข้อมูลที่ต้องการได้อย่างถูกต้อง
หลังจากดึงข้อมูลสำเร็จ คุณจะเห็นค่าการตั้งค่าของ IdP ที่ถูกแยกวิเคราะห์แล้วในส่วน issuers</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-scopes-optional">ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-3-configure-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)" translate="no">​</a></h2>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชีองค์กรของพวกเขาได้บ้าง</p>
<p>การตั้งค่าขอบเขต (Scopes) ต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<ol>
<li class=""><strong>ผู้ให้บริการข้อมูลระบุตัวตน (IdP) ของคุณ</strong>: กำหนดว่าสิทธิ์ใดได้รับอนุญาตสำหรับการอนุญาต (Authorization) ในคอนโซล IdP ของคุณ<!-- -->
<ul>
<li class="">บาง IdP เปิดใช้งานขอบเขตสาธารณะทั้งหมดโดยค่าเริ่มต้น (ไม่ต้องดำเนินการใด ๆ)</li>
<li class="">บางรายต้องให้คุณอนุญาตสิทธิ์อย่างชัดเจน</li>
</ul>
</li>
<li class=""><strong>ตัวเชื่อมต่อองค์กร Logto</strong>: ระบุขอบเขตที่จะร้องขอระหว่างการยืนยันตัวตน (Authentication) ในการตั้งค่าตัวเชื่อมต่อ OIDC องค์กรของ Logto &gt; ช่อง <code>Scopes</code>
<ul>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> เสมอ เพื่อดึงข้อมูลตัวตนผู้ใช้พื้นฐาน ไม่ว่าคุณจะตั้งค่าขอบเขตเองอย่างไร</li>
<li class="">คุณสามารถเพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) เพื่อขอข้อมูลเพิ่มเติมจาก IdP ได้</li>
</ul>
</li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณต้องเข้าถึง API โดยใช้ขอบเขตเหล่านี้ อย่าลืมเปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง (Store tokens for persistent API access)</strong> ในตัวเชื่อมต่อองค์กร Logto ของคุณ ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-store-tokens-to-access-third-party-apis-optional">ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-4-store-tokens-to-access-third-party-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)" translate="no">​</a></h2>
<p>หากคุณต้องการเข้าถึง API ของผู้ให้บริการข้อมูลระบุตัวตน (Identity provider) และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่ต้องการในช่อง <strong>scope</strong> ตามคำแนะนำข้างต้น</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API อย่างต่อเนื่อง (Store tokens for persistent API access)</strong> ในตัวเชื่อมต่อ OIDC สำหรับองค์กรของ Logto โดย Logto จะจัดเก็บโทเค็นการเข้าถึง (access tokens) ไว้อย่างปลอดภัยใน Secret Vault</li>
<li class="">สำหรับผู้ให้บริการข้อมูลระบุตัวตน OIDC <strong>มาตรฐาน</strong> ต้องใส่ขอบเขต <code>offline_access</code> เพื่อให้ได้รับโทเค็นรีเฟรช (refresh token) ซึ่งจะช่วยป้องกันการขอความยินยอมจากผู้ใช้ซ้ำ ๆ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h2>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO ให้เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->OIDC enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->ปลั๊กอิน WordPress<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->OIDC enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>oidc-enterprise-sso</category>
            <category>wordpress-plugin</category>
            <category>php</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Okta enterprise SSO ด้วย Vanilla JS]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Okta enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a></li>
<li class="">มีบัญชี <!-- -->Okta enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->แอปหน้าเดียว (Single page app)<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vanilla JS<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vanilla JS กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">vanilla-js SDK เป็น <span class="linkWrapper_B4Bt"><a href="https://stackoverflow.com/questions/64725017/what-does-it-mean-by-framework-agnostic" target="_blank" rel="noopener noreferrer" class="link_hf7f">framework-agnostic<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คุณสามารถใช้กับเฟรมเวิร์กฝั่งหน้าเว็บใดก็ได้โดยเขียนตัวห่อ (wrapper) ให้เหมาะสม</li>
<li class="">โปรเจกต์ตัวอย่างมีให้ใน <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/browser-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<p>เลือกตัวจัดการแพ็กเกจที่คุณชื่นชอบ หรือใช้ CDN เพื่อติดตั้ง Logto Browser SDK</p>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">CDN</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขอบคุณ jsdelivr เป็นพิเศษ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">type</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">module</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript">  </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token script language-javascript"> </span><span class="token script language-javascript imports maybe-class-name">LogtoClient</span><span class="token script language-javascript"> </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token script language-javascript"> </span><span class="token script language-javascript string" style="color:rgb(255, 121, 198)">'https://cdn.jsdelivr.net/npm/@logto/browser@2.2.13/+esm'</span><span class="token script language-javascript punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและเริ่มต้นอินสแตนซ์ <code>LogtoClient</code> โดยส่ง config เข้าไป:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">index.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> LogtoClient </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/browser'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> logtoClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>คุณสามารถค้นหา <code>endpoint</code> และ <code>appId</code> ได้จากหน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-a-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-a-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีขั้นตอนที่ต้องดำเนินการหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการขั้นตอนนี้อย่างถูกต้องกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Callback.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">callbackHandler</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">handleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">href</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">!</span><span class="token plain">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้ไม่สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token function" style="color:rgb(80, 250, 123)">alert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'ลงชื่อเข้าใช้ไม่สำเร็จ'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">assign</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'/'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p><code>logtoClient</code> มีเมธอด <code>signIn</code> และ <code>signOut</code> เพื่อช่วยให้คุณจัดการกระบวนการการยืนยันตัวตน (Authentication) ได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Home.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มออกจากระบบ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">appendChild</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-authentication-status">จัดการสถานะการยืนยันตัวตน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-authentication-status" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" title="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" translate="no">​</a></h3>
<p>ใน Logto SDK โดยทั่วไปเราสามารถใช้ <code>logtoClient.isAuthenticated</code> เพื่อตรวจสอบสถานะการยืนยันตัวตน (authentication) หากผู้ใช้ลงชื่อเข้าใช้แล้ว ค่านี้จะเป็น <code>true</code> หากยังไม่ได้ลงชื่อเข้าใช้ ค่านี้จะเป็น <code>false</code></p>
<p>ในแอป vanilla JS ของคุณ คุณสามารถใช้สถานะ <code>isAuthenticated</code> เพื่อแสดงหรือซ่อนปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบอัตโนมัติ มาดูวิธีการทำกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> redirectUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> baseUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// การแสดงผลปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบมีเงื่อนไข</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">render</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> container </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">querySelector</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#container'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">baseUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  container</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">append</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Okta enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vanilla JS<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-okta-admin-portal">ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-1-create-an-oidc-application-on-okta-admin-portal" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" translate="no">​</a></h3>
<ul>
<li class="">ไปที่พอร์ทัลผู้ดูแลระบบ Okta และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">ไปที่หน้า <code>Applications</code> / <code>Applications</code> โดยใช้เมนูด้านข้าง</li>
<li class="">คลิกปุ่ม <code>Create App Integration</code> เพื่อสร้างแอป OIDC ใหม่</li>
<li class="">เลือกตัวเลือก <code>OIDC - OpenID Connect</code> เป็น <code>Sign-in method</code></li>
<li class="">เลือกตัวเลือก <code>Web Application</code> เป็น <code>Application type</code></li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_create_application.webp" alt="สร้างแอปพลิเคชัน Okta">
<p>คลิกปุ่ม <code>Next</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-the-application-settings">ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-2-configure-the-application-settings" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" translate="no">​</a></h3>
<ol>
<li class="">กำหนด <code>App integration name</code> ซึ่งจะใช้เป็นตัวระบุของแอปพลิเคชัน OIDC ของคุณ</li>
<li class="">เพิ่ม <code>Sign-in redirect URIs</code> ใหม่โดยใช้ callback URL ของตัวเชื่อมต่อ Logto SSO</li>
</ol>
<p>นี่คือ URI ที่ Okta จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตน (Authentication) สำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI ที่กำหนดนี้พร้อมกับรหัสการอนุญาต (authorization code) Logto จะดำเนินการยืนยันตัวตน (Authentication) ให้สมบูรณ์โดยอิงจากรหัสการอนุญาตที่ได้รับจาก URI นี้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_application_settings.webp" alt="การตั้งค่าแอปพลิเคชัน Okta">
<ol start="3">
<li class="">กำหนดผู้ใช้ให้กับแอปพลิเคชัน</li>
</ol>
<p>ตามการตั้งค่า <code>Assignments</code> คุณสามารถเลือกกำหนดแอปพลิเคชันให้กับผู้ใช้ทั้งหมด หรือเฉพาะผู้ใช้ / กลุ่มที่ต้องการ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_assign_users.webp" alt="Okta assign users">
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าแอปพลิเคชัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-3-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC สำเร็จแล้ว คุณจะถูกเปลี่ยนเส้นทางไปยังหน้ารายละเอียดของแอปพลิเคชัน</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_client_credentials.webp" alt="Okta client credentials">
<p>คัดลอก <code>client ID</code> และ <code>client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ใช้โดเมน Okta ของคุณเป็น <code>issuer</code> ตัวอย่าง: <code>https://dev-12345678.okta.com</code> เมื่อกรอกข้อมูลครบทุกช่องแล้ว ให้คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าตัวเชื่อมต่อ</p>
<p>หากลิงก์ <code>issuer</code> ที่คุณให้มาถูกต้อง คุณจะเห็นรายการการตั้งค่า Okta IdP ที่ถูกแยกแสดงแบบเต็มด้านล่างช่อง <code>issuer</code></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-additional-scopes-optional">ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-4-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Okta ของพวกเขาได้ การร้องขอสิทธิ์ Okta เพิ่มเติมจำเป็นต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Okta admin console:</strong></p>
<ol>
<li class="">ไปที่ <strong>Applications &gt; Applications</strong> และเลือกแอป OIDC ของคุณ</li>
<li class="">ไปที่แท็บ <strong>Assignments</strong> เพื่อให้แน่ใจว่าแอปของคุณสามารถเข้าถึงผู้ใช้และกลุ่มที่ต้องการได้</li>
<li class="">สำหรับขอบเขตแบบกำหนดเอง ให้ไปที่ <strong>Security &gt; API &gt; Authorization Servers</strong> และเลือก authorization server ของคุณ</li>
<li class="">เพิ่มขอบเขตแบบกำหนดเองหากจำเป็น:<!-- -->
<ul>
<li class="">คลิก <strong>Scopes</strong> แล้วเลือก <strong>Add Scope</strong></li>
<li class="">กำหนดชื่อขอบเขต เช่น <code>okta.users.read</code> หรือ <code>okta.groups.read</code> สำหรับการเข้าถึง Okta APIs</li>
<li class="">กำหนดข้อกำหนดการขอความยินยอม (consent) สำหรับแต่ละขอบเขต</li>
</ul>
</li>
</ol>
<p>สำหรับรายการขอบเขตที่มีทั้งหมดและคำอธิบาย โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/api/openapi/okta-oauth/guides/overview/#scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสาร Okta OIDC<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ใน Logto Okta connector:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณต้องการจัดเก็บโทเค็นเพื่อเข้าถึง API แบบถาวร ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรช (Refresh token) สำหรับการเข้าถึง API ระยะยาว</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Okta เช่น <code>okta.users.read okta.groups.read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Okta APIs และดำเนินการต่าง ๆ โปรดตรวจสอบให้แน่ใจว่าได้เปิดใช้งาน <strong>Store tokens for persistent API access</strong> ใน Logto Okta connector ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-store-tokens-to-access-okta-apis-optional">ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-5-store-tokens-to-access-okta-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/guides/request-user-consent/main/#enable-consent-for-scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">Okta scopes<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต (scopes) เฉพาะและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าตั้งค่าสิทธิ์ API ของ Okta developer console และในตัวเชื่อมต่อ Okta ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API แบบถาวร</strong> ในตัวเชื่อมต่อ Okta ของ Logto โดย Logto จะจัดเก็บ Okta access และ refresh tokens อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่า refresh tokens จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอป Okta ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Okta ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-6-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการสร้างการเชื่อมต่อ OIDC กับ Okta โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://help.okta.com/oie/en-us/content/topics/apps/apps_app_integration_wizard_oidc.htm" target="_blank" rel="noopener noreferrer" class="link_hf7f">Create OIDC App Integrations<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Okta enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vanilla JS<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Okta enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vanilla-js-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>okta-enterprise-sso</category>
            <category>vanilla-js</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง OIDC enterprise SSO ด้วย Vue]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->OIDC enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a></li>
<li class="">มีบัญชี <!-- -->OIDC enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vue<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vue กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">Logto Vue SDK ถูกสร้างขึ้นด้วย composition API และใช้ composables ดังนั้นจึงรองรับเฉพาะ Vue 3 เท่านั้น</li>
<li class="">วิดีโอแนะนำมีให้รับชมบน <span class="linkWrapper_B4Bt"><a href="https://youtu.be/cAfsQrsGQqA" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">โปรเจกต์ตัวอย่างฉบับเต็มสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/vue-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>createLogto</code> เพื่อติดตั้งปลั๊กอิน Logto:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">main.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> LogtoConfig </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createApp </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> App </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'./App.vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// กำหนดค่าการเชื่อมต่อ Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> LogtoConfig </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> app </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">App</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">mount</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#app'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีสิ่งที่ต้องทำหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการให้ถูกต้องกัน</p>
<p>ก่อนอื่น สร้างหน้าคอลแบ็ก (callback) ดังนี้:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/CallbackView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> useHandleSignInCallback </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> router </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@/router'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขณะกำลังดำเนินการ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">isLoading</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>แทรกโค้ดด้านล่างในเส้นทาง <code>/callback</code> ของคุณ ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">router/index.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ vue-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> router </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createRouter</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  routes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      path</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      component</span><span class="token operator">:</span><span class="token plain"> CallbackView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี composable สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ที่ช่วยให้คุณจัดการโฟลว์การยืนยันตัวตนได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/HomeView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ดึงฟังก์ชัน signIn, signOut และตัวแปร isAuthenticated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">!isAuthenticated</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignIn</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ลงชื่อเข้าใช้</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-else</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignOut</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ออกจากระบบ</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vue<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on your IdP<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on your IdP" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on your IdP" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-your-idp">ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-1-create-an-oidc-application-on-your-idp" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ" translate="no">​</a></h3>
<p>เริ่มต้นการผสานรวม OIDC SSO โดยการสร้างแอปพลิเคชันฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP) คุณจะต้องใช้การตั้งค่าต่อไปนี้จากเซิร์ฟเวอร์ Logto</p>
<ul>
<li class=""><strong>Callback URI</strong>: Logto Callback URI หรือที่รู้จักกันในชื่อ Redirect URI หรือ Reply URL คือจุดปลายทาง (endpoint) หรือ URL เฉพาะที่ IdP ใช้สำหรับเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตนสำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จแล้ว IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมายัง URI ที่กำหนดนี้พร้อมกับ authorization code จากนั้น Logto จะดำเนินการยืนยันตัวตนให้สมบูรณ์โดยอิงจาก authorization code ที่ได้รับจาก URI นี้</li>
</ul>
<p>กรอก Logto Callback URI ลงในฟอร์มตั้งค่าแอป OIDC ของ IdP ของคุณ แล้วดำเนินการสร้างแอปพลิเคชันต่อไป (IdP OIDC ส่วนใหญ่มีประเภทแอปพลิเคชันให้เลือกหลากหลายรูปแบบ หากต้องการสร้างตัวเชื่อมต่อ SSO แบบเว็บบน Logto โปรดเลือกประเภท <code>Web Application</code>)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-oidc-sso-on-logto">ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-2-configure-oidc-sso-on-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC บนฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP) สำเร็จแล้ว คุณจะต้องนำค่าการตั้งค่าของ IdP กลับมากรอกใน Logto โดยไปที่แท็บ <code>Connection</code> และกรอกค่าต่อไปนี้:</p>
<ul>
<li class=""><strong>Client ID</strong>: ตัวระบุที่ไม่ซ้ำกันซึ่ง IdP กำหนดให้กับแอปพลิเคชัน OIDC ของคุณ ตัวระบุตัวนี้ใช้โดย Logto เพื่อระบุและยืนยันตัวตนของแอปพลิเคชันระหว่างกระบวนการ OIDC</li>
<li class=""><strong>Client Secret</strong>: รหัสลับที่ใช้ร่วมกันระหว่าง Logto กับ IdP รหัสลับนี้ใช้เพื่อยืนยันตัวตนของแอปพลิเคชัน OIDC และรักษาความปลอดภัยของการสื่อสารระหว่าง Logto กับ IdP</li>
<li class=""><strong>ผู้ออก (Issuer)</strong>: URL ของผู้ออก ซึ่งเป็นตัวระบุที่ไม่ซ้ำกันสำหรับ IdP โดยระบุที่ตั้งของผู้ให้บริการข้อมูลระบุตัวตน OIDC ถือเป็นส่วนสำคัญของการตั้งค่า OIDC เพราะช่วยให้ Logto ค้นหา endpoint ที่จำเป็นได้
เพื่อให้ง่ายต่อการตั้งค่า Logto จะดึง endpoint และการตั้งค่าที่จำเป็นของ OIDC มาให้อัตโนมัติ โดยใช้ผู้ออก (issuer) ที่คุณระบุและเรียกไปยัง OIDC discover endpoint ของ IdP ดังนั้นจึงจำเป็นต้องตรวจสอบให้แน่ใจว่า endpoint ของผู้ออกถูกต้องและตั้งค่าอย่างแม่นยำ เพื่อให้ Logto สามารถดึงข้อมูลที่ต้องการได้อย่างถูกต้อง
หลังจากดึงข้อมูลสำเร็จ คุณจะเห็นค่าการตั้งค่าของ IdP ที่ถูกแยกวิเคราะห์แล้วในส่วน issuers</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-scopes-optional">ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-3-configure-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)" translate="no">​</a></h2>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชีองค์กรของพวกเขาได้บ้าง</p>
<p>การตั้งค่าขอบเขต (Scopes) ต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<ol>
<li class=""><strong>ผู้ให้บริการข้อมูลระบุตัวตน (IdP) ของคุณ</strong>: กำหนดว่าสิทธิ์ใดได้รับอนุญาตสำหรับการอนุญาต (Authorization) ในคอนโซล IdP ของคุณ<!-- -->
<ul>
<li class="">บาง IdP เปิดใช้งานขอบเขตสาธารณะทั้งหมดโดยค่าเริ่มต้น (ไม่ต้องดำเนินการใด ๆ)</li>
<li class="">บางรายต้องให้คุณอนุญาตสิทธิ์อย่างชัดเจน</li>
</ul>
</li>
<li class=""><strong>ตัวเชื่อมต่อองค์กร Logto</strong>: ระบุขอบเขตที่จะร้องขอระหว่างการยืนยันตัวตน (Authentication) ในการตั้งค่าตัวเชื่อมต่อ OIDC องค์กรของ Logto &gt; ช่อง <code>Scopes</code>
<ul>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> เสมอ เพื่อดึงข้อมูลตัวตนผู้ใช้พื้นฐาน ไม่ว่าคุณจะตั้งค่าขอบเขตเองอย่างไร</li>
<li class="">คุณสามารถเพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) เพื่อขอข้อมูลเพิ่มเติมจาก IdP ได้</li>
</ul>
</li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณต้องเข้าถึง API โดยใช้ขอบเขตเหล่านี้ อย่าลืมเปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง (Store tokens for persistent API access)</strong> ในตัวเชื่อมต่อองค์กร Logto ของคุณ ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-store-tokens-to-access-third-party-apis-optional">ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-4-store-tokens-to-access-third-party-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)" translate="no">​</a></h2>
<p>หากคุณต้องการเข้าถึง API ของผู้ให้บริการข้อมูลระบุตัวตน (Identity provider) และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่ต้องการในช่อง <strong>scope</strong> ตามคำแนะนำข้างต้น</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API อย่างต่อเนื่อง (Store tokens for persistent API access)</strong> ในตัวเชื่อมต่อ OIDC สำหรับองค์กรของ Logto โดย Logto จะจัดเก็บโทเค็นการเข้าถึง (access tokens) ไว้อย่างปลอดภัยใน Secret Vault</li>
<li class="">สำหรับผู้ให้บริการข้อมูลระบุตัวตน OIDC <strong>มาตรฐาน</strong> ต้องใส่ขอบเขต <code>offline_access</code> เพื่อให้ได้รับโทเค็นรีเฟรช (refresh token) ซึ่งจะช่วยป้องกันการขอความยินยอมจากผู้ใช้ซ้ำ ๆ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h2>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO ให้เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->OIDC enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vue<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->OIDC enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vue-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>oidc-enterprise-sso</category>
            <category>vue</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Okta enterprise SSO ด้วย Vue]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Okta enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a></li>
<li class="">มีบัญชี <!-- -->Okta enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vue<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vue กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">Logto Vue SDK ถูกสร้างขึ้นด้วย composition API และใช้ composables ดังนั้นจึงรองรับเฉพาะ Vue 3 เท่านั้น</li>
<li class="">วิดีโอแนะนำมีให้รับชมบน <span class="linkWrapper_B4Bt"><a href="https://youtu.be/cAfsQrsGQqA" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">โปรเจกต์ตัวอย่างฉบับเต็มสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/vue-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>createLogto</code> เพื่อติดตั้งปลั๊กอิน Logto:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">main.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> LogtoConfig </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createApp </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> App </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'./App.vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// กำหนดค่าการเชื่อมต่อ Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> LogtoConfig </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> app </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">App</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">mount</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#app'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีสิ่งที่ต้องทำหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการให้ถูกต้องกัน</p>
<p>ก่อนอื่น สร้างหน้าคอลแบ็ก (callback) ดังนี้:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/CallbackView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> useHandleSignInCallback </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> router </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@/router'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขณะกำลังดำเนินการ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">isLoading</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>แทรกโค้ดด้านล่างในเส้นทาง <code>/callback</code> ของคุณ ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">router/index.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ vue-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> router </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createRouter</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  routes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      path</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      component</span><span class="token operator">:</span><span class="token plain"> CallbackView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี composable สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ที่ช่วยให้คุณจัดการโฟลว์การยืนยันตัวตนได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/HomeView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ดึงฟังก์ชัน signIn, signOut และตัวแปร isAuthenticated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">!isAuthenticated</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignIn</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ลงชื่อเข้าใช้</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-else</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignOut</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ออกจากระบบ</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Okta enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vue<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-okta-admin-portal">ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#step-1-create-an-oidc-application-on-okta-admin-portal" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" translate="no">​</a></h3>
<ul>
<li class="">ไปที่พอร์ทัลผู้ดูแลระบบ Okta และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">ไปที่หน้า <code>Applications</code> / <code>Applications</code> โดยใช้เมนูด้านข้าง</li>
<li class="">คลิกปุ่ม <code>Create App Integration</code> เพื่อสร้างแอป OIDC ใหม่</li>
<li class="">เลือกตัวเลือก <code>OIDC - OpenID Connect</code> เป็น <code>Sign-in method</code></li>
<li class="">เลือกตัวเลือก <code>Web Application</code> เป็น <code>Application type</code></li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_create_application.webp" alt="สร้างแอปพลิเคชัน Okta">
<p>คลิกปุ่ม <code>Next</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-the-application-settings">ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#step-2-configure-the-application-settings" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" translate="no">​</a></h3>
<ol>
<li class="">กำหนด <code>App integration name</code> ซึ่งจะใช้เป็นตัวระบุของแอปพลิเคชัน OIDC ของคุณ</li>
<li class="">เพิ่ม <code>Sign-in redirect URIs</code> ใหม่โดยใช้ callback URL ของตัวเชื่อมต่อ Logto SSO</li>
</ol>
<p>นี่คือ URI ที่ Okta จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตน (Authentication) สำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI ที่กำหนดนี้พร้อมกับรหัสการอนุญาต (authorization code) Logto จะดำเนินการยืนยันตัวตน (Authentication) ให้สมบูรณ์โดยอิงจากรหัสการอนุญาตที่ได้รับจาก URI นี้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_application_settings.webp" alt="การตั้งค่าแอปพลิเคชัน Okta">
<ol start="3">
<li class="">กำหนดผู้ใช้ให้กับแอปพลิเคชัน</li>
</ol>
<p>ตามการตั้งค่า <code>Assignments</code> คุณสามารถเลือกกำหนดแอปพลิเคชันให้กับผู้ใช้ทั้งหมด หรือเฉพาะผู้ใช้ / กลุ่มที่ต้องการ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_assign_users.webp" alt="Okta assign users">
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าแอปพลิเคชัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#step-3-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC สำเร็จแล้ว คุณจะถูกเปลี่ยนเส้นทางไปยังหน้ารายละเอียดของแอปพลิเคชัน</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_client_credentials.webp" alt="Okta client credentials">
<p>คัดลอก <code>client ID</code> และ <code>client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ใช้โดเมน Okta ของคุณเป็น <code>issuer</code> ตัวอย่าง: <code>https://dev-12345678.okta.com</code> เมื่อกรอกข้อมูลครบทุกช่องแล้ว ให้คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าตัวเชื่อมต่อ</p>
<p>หากลิงก์ <code>issuer</code> ที่คุณให้มาถูกต้อง คุณจะเห็นรายการการตั้งค่า Okta IdP ที่ถูกแยกแสดงแบบเต็มด้านล่างช่อง <code>issuer</code></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-additional-scopes-optional">ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#step-4-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Okta ของพวกเขาได้ การร้องขอสิทธิ์ Okta เพิ่มเติมจำเป็นต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Okta admin console:</strong></p>
<ol>
<li class="">ไปที่ <strong>Applications &gt; Applications</strong> และเลือกแอป OIDC ของคุณ</li>
<li class="">ไปที่แท็บ <strong>Assignments</strong> เพื่อให้แน่ใจว่าแอปของคุณสามารถเข้าถึงผู้ใช้และกลุ่มที่ต้องการได้</li>
<li class="">สำหรับขอบเขตแบบกำหนดเอง ให้ไปที่ <strong>Security &gt; API &gt; Authorization Servers</strong> และเลือก authorization server ของคุณ</li>
<li class="">เพิ่มขอบเขตแบบกำหนดเองหากจำเป็น:<!-- -->
<ul>
<li class="">คลิก <strong>Scopes</strong> แล้วเลือก <strong>Add Scope</strong></li>
<li class="">กำหนดชื่อขอบเขต เช่น <code>okta.users.read</code> หรือ <code>okta.groups.read</code> สำหรับการเข้าถึง Okta APIs</li>
<li class="">กำหนดข้อกำหนดการขอความยินยอม (consent) สำหรับแต่ละขอบเขต</li>
</ul>
</li>
</ol>
<p>สำหรับรายการขอบเขตที่มีทั้งหมดและคำอธิบาย โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/api/openapi/okta-oauth/guides/overview/#scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสาร Okta OIDC<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ใน Logto Okta connector:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณต้องการจัดเก็บโทเค็นเพื่อเข้าถึง API แบบถาวร ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรช (Refresh token) สำหรับการเข้าถึง API ระยะยาว</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Okta เช่น <code>okta.users.read okta.groups.read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Okta APIs และดำเนินการต่าง ๆ โปรดตรวจสอบให้แน่ใจว่าได้เปิดใช้งาน <strong>Store tokens for persistent API access</strong> ใน Logto Okta connector ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-store-tokens-to-access-okta-apis-optional">ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#step-5-store-tokens-to-access-okta-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/guides/request-user-consent/main/#enable-consent-for-scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">Okta scopes<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต (scopes) เฉพาะและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าตั้งค่าสิทธิ์ API ของ Okta developer console และในตัวเชื่อมต่อ Okta ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API แบบถาวร</strong> ในตัวเชื่อมต่อ Okta ของ Logto โดย Logto จะจัดเก็บ Okta access และ refresh tokens อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่า refresh tokens จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอป Okta ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Okta ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#step-6-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการสร้างการเชื่อมต่อ OIDC กับ Okta โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://help.okta.com/oie/en-us/content/topics/apps/apps_app_integration_wizard_oidc.htm" target="_blank" rel="noopener noreferrer" class="link_hf7f">Create OIDC App Integrations<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Okta enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vue<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Okta enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-vue-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>okta-enterprise-sso</category>
            <category>vue</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง SAML enterprise SSO ด้วย Vue]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->SAML enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a></li>
<li class="">มีบัญชี <!-- -->SAML enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vue<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vue กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">Logto Vue SDK ถูกสร้างขึ้นด้วย composition API และใช้ composables ดังนั้นจึงรองรับเฉพาะ Vue 3 เท่านั้น</li>
<li class="">วิดีโอแนะนำมีให้รับชมบน <span class="linkWrapper_B4Bt"><a href="https://youtu.be/cAfsQrsGQqA" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">โปรเจกต์ตัวอย่างฉบับเต็มสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/vue-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>createLogto</code> เพื่อติดตั้งปลั๊กอิน Logto:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">main.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> LogtoConfig </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createApp </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> App </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'./App.vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// กำหนดค่าการเชื่อมต่อ Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> LogtoConfig </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> app </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">App</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">mount</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#app'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีสิ่งที่ต้องทำหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการให้ถูกต้องกัน</p>
<p>ก่อนอื่น สร้างหน้าคอลแบ็ก (callback) ดังนี้:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/CallbackView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> useHandleSignInCallback </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> router </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@/router'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขณะกำลังดำเนินการ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">isLoading</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>แทรกโค้ดด้านล่างในเส้นทาง <code>/callback</code> ของคุณ ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">router/index.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ vue-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> router </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createRouter</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  routes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      path</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      component</span><span class="token operator">:</span><span class="token plain"> CallbackView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี composable สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ที่ช่วยให้คุณจัดการโฟลว์การยืนยันตัวตนได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/HomeView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ดึงฟังก์ชัน signIn, signOut และตัวแปร isAuthenticated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">!isAuthenticated</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignIn</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ลงชื่อเข้าใช้</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-else</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignOut</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ออกจากระบบ</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ SAML enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ SAML enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ SAML enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vue<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า SAML SSO application on your IdP<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า SAML SSO application on your IdP" title="ลิงก์ตรงไปยัง ตั้งค่า SAML SSO application on your IdP" translate="no">​</a></h2>
<p>ขั้นตอนที่ 1: สร้างแอปพลิเคชัน SAML SSO บน IdP ของคุณ {#step-1-create-a-saml-sso-application-on-your-idp}</p>
<p>เริ่มต้นการผสานรวม SAML Single Sign-On (SSO) โดยการสร้างแอปพลิเคชันในฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP). รับค่าการตั้งค่าต่อไปนี้จาก Logto ซึ่งแสดงถึง Service Provider (SP) ของคุณ:</p>
<ul>
<li class=""><strong>Audience URI (SP Entity ID)</strong>: ใช้เป็นตัวระบุที่ไม่ซ้ำกันทั่วโลกสำหรับบริการ Logto ของคุณ ทำหน้าที่เป็น EntityId สำหรับ SP ในระหว่างคำขอการยืนยันตัวตน (Authentication request) ไปยัง IdP. ตัวระบุตัวนี้มีความสำคัญต่อการแลกเปลี่ยนข้อมูล SAML assertion และข้อมูลที่เกี่ยวข้องกับการยืนยันตัวตนอื่น ๆ อย่างปลอดภัยระหว่าง IdP กับ Logto</li>
<li class=""><strong>ACS URL</strong>: Assertion Consumer Service (ACS) URL คือที่อยู่ที่ SAML assertion จะถูกส่งมาด้วยคำขอแบบ POST. URL นี้ใช้โดย IdP เพื่อส่ง SAML assertion มายัง Logto โดยทำหน้าที่เป็น callback URL ที่ Logto คาดว่าจะได้รับและประมวลผล SAML response ที่มีข้อมูลอัตลักษณ์ของผู้ใช้</li>
</ul>
<p>กรอกค่า Audience URI และ ACS URL ในแอป SAML ของ IdP ของคุณ และดำเนินการต่อเพื่อดึงค่าการตั้งค่าต่อไปนี้จาก IdP ของคุณ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-saml-sso-on-logto">ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#step-2-configure-saml-sso-on-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto" translate="no">​</a></h3>
<p>เพื่อให้การเชื่อมต่อ SAML SSO ทำงานได้ คุณจะต้องให้ข้อมูลเมทาดาทาของผู้ให้บริการข้อมูลระบุตัวตน (IdP) กับ Logto เมทาดาทา IdP คือเอกสาร <span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/what-is-xml" target="_blank" rel="noopener noreferrer" class="link_hf7f">XML<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ที่มีข้อมูลทั้งหมดที่จำเป็นสำหรับ Logto ในการสร้างความเชื่อถือกับ IdP</p>
<p>ไปที่แท็บ <code>Connection</code> Logto มี 3 วิธีในการกำหนดค่าเมทาดาทา IdP ดังนี้:</p>
<ol>
<li class=""><strong>Metadata URL</strong>: ระบุ URL ของเอกสาร IdP metadata XML Logto จะดึงข้อมูลเมทาดาทาจาก URL และกำหนดค่า SAML SSO ให้อัตโนมัติ</li>
<li class=""><strong>Upload Metadata</strong>: อัปโหลดเอกสาร IdP metadata XML Logto จะวิเคราะห์เอกสาร XML และกำหนดค่า SAML SSO ให้อัตโนมัติ</li>
<li class=""><strong>Manual Configuration</strong>: กำหนดค่าเมทาดาทา IdP ด้วยตนเอง</li>
</ol>
<ul>
<li class="">IdP entity ID: Entity ID ของ IdP</li>
<li class="">Single sign-on URL: URL ของบริการ Single Sign-On ของ IdP</li>
<li class="">Signing certificate: ใบรับรอง x509 ใช้สำหรับตรวจสอบลายเซ็นของ SAML response ที่มาจาก IdP</li>
</ul>
<p>ไม่ว่าคุณจะเลือกวิธีใด Logto จะวิเคราะห์เมทาดาทา IdP และกำหนดค่า SAML SSO ให้สอดคล้องกัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-user-attributes-mapping">ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#step-3-configure-user-attributes-mapping" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้" translate="no">​</a></h3>
<p>แอตทริบิวต์ของผู้ใช้ที่ส่งกลับมาจาก IdP อาจแตกต่างกันไปขึ้นอยู่กับการตั้งค่าของ IdP Logto มีวิธีที่ยืดหยุ่นในการแมปแอตทริบิวต์ของผู้ใช้ที่ได้รับจาก IdP ไปยังแอตทริบิวต์ของผู้ใช้ใน Logto คุณสามารถกำหนดค่าการแมปแอตทริบิวต์ของผู้ใช้ได้ในแท็บประสบการณ์การผสานรวม SAML SSO</p>
<ul>
<li class="">id: ตัวระบุเฉพาะของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (claim) <code>nameId</code> จาก SAML response เป็นรหัส SSO identity ของผู้ใช้</li>
<li class="">email: ที่อยู่อีเมลของผู้ใช้</li>
<li class="">name: ชื่อของผู้ใช้</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step4-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#step4-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO ให้เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SAML SSO เป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->SAML enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vue<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->SAML enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vue-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>saml-enterprise-sso</category>
            <category>vue</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Microsoft Entra ID OIDC enterprise SSO ด้วย ปลั๊กอิน WordPress]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://wordpress.org/" target="_blank" rel="noopener">ปลั๊กอิน WordPress</a></li>
<li class="">มีบัญชี <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->เว็บแบบดั้งเดิม<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->เว็บแบบดั้งเดิม<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->เว็บแบบดั้งเดิม<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->WordPress<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม WordPress กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม WordPress กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="install-the-plugin">ติดตั้งปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#install-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" title="ลิงก์ตรงไปยัง ติดตั้งปลั๊กอิน" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">จากแผงผู้ดูแล WordPress</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">จากการอัปโหลด</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><ol>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong>.</li>
<li class="">ค้นหา "Logto" หรือกรอก <span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">https://wordpress.org/plugins/logto/<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในช่องค้นหา</li>
<li class="">คลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div><div role="tabpanel" class="tabItem_pED3" hidden=""><ol>
<li class="">ดาวน์โหลดปลั๊กอิน Logto WordPress จากลิงก์ใดลิงก์หนึ่งต่อไปนี้:<!-- -->
<ul>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/wordpress/releases" target="_blank" rel="noopener noreferrer" class="link_hf7f">รุ่นล่าสุด (Latest release)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์ที่มีชื่อในรูปแบบ <code>logto-plugin-&lt;version&gt;.zip</code></li>
<li class=""><span class="linkWrapper_B4Bt"><a href="https://wordpress.org/plugins/logto/" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไดเรกทอรีปลั๊กอิน WordPress (WordPress plugin directory)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ดาวน์โหลดไฟล์โดยคลิกปุ่ม <strong>ดาวน์โหลด (Download)</strong></li>
</ul>
</li>
<li class="">ดาวน์โหลดไฟล์ ZIP ของปลั๊กอิน</li>
<li class="">ไปที่ <strong>ปลั๊กอิน (Plugins)</strong> &gt; <strong>เพิ่มใหม่ (Add New)</strong> ในแผงผู้ดูแล WordPress ของคุณ</li>
<li class="">คลิก <strong>อัปโหลดปลั๊กอิน (Upload Plugin)</strong></li>
<li class="">เลือกไฟล์ ZIP ที่ดาวน์โหลดมาแล้วคลิก <strong>ติดตั้งตอนนี้ (Install Now)</strong></li>
<li class="">คลิก <strong>เปิดใช้งาน (Activate)</strong></li>
</ol></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-the-plugin">ตั้งค่าปลั๊กอิน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-the-plugin" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" title="ลิงก์ตรงไปยัง ตั้งค่าปลั๊กอิน" translate="no">​</a></h3>
<p>ตอนนี้คุณควรจะเห็นเมนู Logto ในแถบด้านข้างของแผงผู้ดูแล WordPress ของคุณ คลิก <strong>Logto</strong> &gt; <strong>Settings</strong> เพื่อกำหนดค่าปลั๊กอิน</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>คุณควรสร้างแอปพลิเคชัน <strong>เว็บแบบดั้งเดิม (traditional web)</strong> ใน Logto Console ก่อนตั้งค่าปลั๊กอิน หากคุณยังไม่ได้สร้าง โปรดดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/integrate-logto/integrate-logto-into-your-application" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>การผสาน Logto เข้ากับแอปพลิเคชันของคุณ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับข้อมูลเพิ่มเติม</p></div></div></div>
<p>การตั้งค่าขั้นต่ำที่จำเป็นสำหรับเริ่มต้นใช้งานปลั๊กอินคือ:</p>
<ul>
<li class="">Logto endpoint: จุดปลายทางของ Logto tenant ของคุณ</li>
<li class="">App ID: รหัสแอปของแอปพลิเคชัน Logto ของคุณ</li>
<li class="">App secret: หนึ่งในรหัสลับแอปที่ถูกต้องของแอปพลิเคชัน Logto ของคุณ</li>
</ul>
<p>ค่าทั้งหมดนี้สามารถดูได้ที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<p>หลังจากกรอกค่าแล้ว คลิก <strong>บันทึกการเปลี่ยนแปลง (Save Changes)</strong> (เลื่อนลงไปด้านล่างของหน้า หากไม่พบปุ่ม)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">ตั้งค่า redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" title="ลิงก์ตรงไปยัง ตั้งค่า redirect URI" translate="no">​</a></h3>
<p>Redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากยืนยันตัวตนเสร็จ; และ post sign-out redirect URI คือ URL ที่ Logto จะเปลี่ยนเส้นทางผู้ใช้ไปหลังจากออกจากระบบ</p>
<p>นี่คือไดอะแกรมลำดับ (sequence diagram) แบบไม่เป็นทางการเพื่อแสดงขั้นตอนการลงชื่อเข้าใช้:</p>
<!-- -->
<p>นี่คือขั้นตอนการออกจากระบบในไดอะแกรมลำดับแบบไม่เป็นทางการ:</p>
<!-- -->
<p>หากต้องการเรียนรู้เพิ่มเติมว่าทำไมต้องมีการเปลี่ยนเส้นทาง ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p>ในกรณีนี้ คุณต้องตั้งค่าทั้งสอง redirect URI ใน Logto Console ของคุณ วิธีค้นหา redirect URI ให้ไปที่หน้า <strong>Logto</strong> &gt; <strong>Settings</strong> ในแผงผู้ดูแล WordPress ของคุณ คุณจะเห็นฟิลด์ <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong></p>
<ol>
<li class="">คัดลอกค่า <strong>Redirect URI</strong> และ <strong>Post sign-out redirect URI</strong> แล้ววางลงในฟิลด์ <strong>Redirect URIs</strong> และ <strong>Post sign-out redirect URIs</strong> ใน Logto Console ของคุณ</li>
<li class="">คลิก <strong>บันทึกการเปลี่ยนแปลง (Save changes)</strong> ใน Logto Console</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-website">จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#checkpoint-test-your-website" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบเว็บไซต์ WordPress ของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบการผสาน Logto ในเว็บไซต์ WordPress ของคุณได้แล้ว:</p>
<ol>
<li class="">เปิดหน้าต่างเบราว์เซอร์แบบไม่ระบุตัวตนหากจำเป็น</li>
<li class="">เข้าเว็บไซต์ WordPress ของคุณแล้วคลิก <strong>เข้าสู่ระบบ (Log in)</strong> หากมี; หรือเข้าหน้าล็อกอินโดยตรง (เช่น <code>https://example.com/wp-login.php</code>)</li>
<li class="">หน้าจะเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">ดำเนินการลงชื่อเข้าใช้หรือสมัครสมาชิกให้เสร็จสิ้น</li>
<li class="">หลังจากยืนยันตัวตนสำเร็จ คุณจะถูกเปลี่ยนเส้นทางกลับไปยังเว็บไซต์ WordPress ของคุณและเข้าสู่ระบบโดยอัตโนมัติ</li>
<li class="">คลิก <strong>ออกจากระบบ (Log out)</strong> เพื่อออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกเปลี่ยนเส้นทางไปยังหน้าออกจากระบบของ Logto แล้วกลับไปยังเว็บไซต์ WordPress ของคุณ</li>
<li class="">คุณจะถูกออกจากระบบเว็บไซต์ WordPress ของคุณ</li>
</ol>
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับการตั้งค่าปลั๊กอิน WordPress โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/quick-starts/wordpress-plugin" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>เริ่มต้นใช้งาน WordPress อย่างรวดเร็ว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->WordPress<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Azure AD SSO application<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" title="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-microsoft-entraid-oidc-application">ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-1-create-an-microsoft-entraid-oidc-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC" translate="no">​</a></h3>
<ol>
<li class="">
<p>ไปที่ <span class="linkWrapper_B4Bt"><a href="https://entra.microsoft.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Microsoft Entra admin center<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</p>
</li>
<li class="">
<p>ไปที่ Identity &gt; Applications &gt; App registrations</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_create_application.webp" alt="สร้างแอปพลิเคชัน"></center>
<ol start="3">
<li class="">
<p>เลือก <code>New registration</code></p>
</li>
<li class="">
<p>กรอกชื่อแอปพลิเคชันและเลือกประเภทบัญชีที่เหมาะสมสำหรับแอปของคุณ</p>
</li>
<li class="">
<p>เลือก <code>Web</code> เป็นแพลตฟอร์มของแอปพลิเคชัน</p>
</li>
<li class="">
<p>คัดลอกและวาง <code>redirect URI</code> จากหน้าการตั้งค่า SSO ของ Logto โดย <code>redirect URI</code> คือ URL ที่ผู้ใช้จะถูกเปลี่ยนเส้นทางไปหลังจากยืนยันตัวตนกับ Microsoft Entra ID แล้ว</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_config_application.webp" alt="กำหนดค่าแอปพลิเคชัน"></center>
<ol start="6">
<li class="">คลิก <code>Register</code> เพื่อสร้างแอปพลิเคชัน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-microsoft-entra-id-oidc-sso-at-logto">ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-2-configure-microsoft-entra-id-oidc-sso-at-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน Microsoft Entra OIDC สำเร็จแล้ว คุณจะต้องนำค่าการตั้งค่าของ IdP กลับมากำหนดใน Logto ให้ไปที่แท็บ <code>Connection</code> ใน Logto Console และกรอกค่าการตั้งค่าต่อไปนี้:</p>
<ol>
<li class=""><strong>Client ID</strong>: ตัวระบุเฉพาะที่ Microsoft Entra กำหนดให้กับแอป OIDC ของคุณ ตัวระบุตัวนี้ใช้โดย Logto เพื่อระบุและยืนยันตัวตนของแอปพลิเคชันระหว่างกระบวนการ OIDC คุณสามารถค้นหาได้ในหน้า overview ของแอปพลิเคชันในส่วน <code>Application (client) ID</code></li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_application_details.webp" alt="รายละเอียดแอปพลิเคชัน"></center>
<ol start="2">
<li class=""><strong>Client Secret</strong>: สร้าง client secret ใหม่และคัดลอกค่าที่ได้ไปใส่ใน Logto รหัสลับนี้ใช้สำหรับยืนยันตัวตนของแอป OIDC และรักษาความปลอดภัยในการสื่อสารระหว่าง Logto กับ IdP</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_create_secret.webp" alt="สร้าง Secret"></center>
<ol start="3">
<li class="">
<p><strong>ผู้ออก (Issuer)</strong>: URL ของผู้ออก ซึ่งเป็นตัวระบุเฉพาะของ IdP ที่ระบุที่ตั้งของผู้ให้บริการข้อมูลระบุตัวตน OIDC เป็นส่วนสำคัญของการตั้งค่า OIDC เพราะช่วยให้ Logto ค้นหา endpoint ที่จำเป็นได้</p>
<p>แทนที่จะต้องกรอก endpoint OIDC ทั้งหมดด้วยตนเอง Logto จะดึงค่าการตั้งค่าและ endpoint ของ IdP ที่จำเป็นทั้งหมดโดยอัตโนมัติ โดยใช้ issuer url ที่คุณให้ไว้และเรียกไปยัง discover endpoint ของ IdP</p>
<p>ในการรับ issuer URL คุณสามารถค้นหาได้ในส่วน <code>Endpoints</code> ของหน้า overview ของแอปพลิเคชัน</p>
<p>ค้นหา endpoint <code>OpenID Connect metadata document</code> และคัดลอก URL <strong>โดยไม่ต้อง</strong>ใส่ path ต่อท้าย <code>.well-known/openid-configuration</code> เนื่องจาก Logto จะเติม <code>.well-known/openid-configuration</code> ต่อท้าย issuer URL ให้อัตโนมัติเมื่อดึงค่าการตั้งค่า OIDC</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_endpoints.webp" alt="Endpoints"></center>
<ol start="4">
<li class=""><strong>ขอบเขต (Scope)</strong> (ไม่บังคับ): Logto จะเพิ่มขอบเขตที่จำเป็น (<code>openid</code>, <code>profile</code>, และ <code>email</code>) ในทุกคำขอโดยอัตโนมัติ คุณสามารถระบุขอบเขตเพิ่มเติมเป็นรายการที่คั่นด้วยช่องว่าง หากแอปของคุณต้องการสิทธิ์หรือระดับการเข้าถึงเพิ่มเติมจาก IdP</li>
</ol>
<p>คลิก <code>Save</code> เพื่อเสร็จสิ้นกระบวนการตั้งค่า</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-additional-scopes-optional">ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-3-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Microsoft Entra ID ของพวกเขาได้ การร้องขอสิทธิ์ Microsoft Graph ต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Microsoft Entra admin center:</strong></p>
<ol>
<li class="">ไปที่ <strong>Microsoft Entra ID &gt; App registrations</strong> และเลือกแอปพลิเคชันของคุณ</li>
<li class="">ไปที่ <strong>API permissions &gt; Add a permission &gt; Microsoft Graph &gt; Delegated permissions</strong></li>
<li class="">เลือกเฉพาะสิทธิ์ที่แอปของคุณต้องการ:<!-- -->
<ul>
<li class="">สิทธิ์ OpenID:<!-- -->
<ul>
<li class=""><code>openid</code> (จำเป็น) - ลงชื่อเข้าใช้ผู้ใช้</li>
<li class=""><code>profile</code> (จำเป็น) - ดูโปรไฟล์พื้นฐานของผู้ใช้</li>
<li class=""><code>email</code> (จำเป็น) - ดูที่อยู่อีเมลของผู้ใช้</li>
<li class=""><code>offline_access</code> (ไม่บังคับ) - ต้องใช้เฉพาะเมื่อคุณเปิดใช้งาน <span class="linkWrapper_B4Bt"><a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-4-store-tokens-to-access-microsoft-apis-optional" class="link_hf7f">จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</a></span> ในตัวเชื่อมต่อ Logto และต้องการรับโทเค็นรีเฟรช (Refresh token) เพื่อเข้าถึง Microsoft Graph APIs แบบยาวนาน</li>
</ul>
</li>
<li class="">การเข้าถึง API (ไม่บังคับ): เพิ่มสิทธิ์เพิ่มเติมที่แอปของคุณต้องการ สิทธิ์ Microsoft Graph ที่พบบ่อย เช่น <code>Mail.Read</code>, <code>Calendars.Read</code>, <code>Files.Read</code> เป็นต้น สามารถดู <span class="linkWrapper_B4Bt"><a href="https://docs.microsoft.com/en-us/graph/permissions-reference" target="_blank" rel="noopener noreferrer" class="link_hf7f">รายการสิทธิ์ของ Microsoft Graph<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อค้นหาสิทธิ์ที่มีให้ใช้งาน</li>
</ul>
</li>
<li class="">คลิก <strong>Add permissions</strong> เพื่อยืนยันการเลือก</li>
<li class="">หากแอปของคุณต้องการการยินยอมจากผู้ดูแลระบบสำหรับสิทธิ์บางรายการ ให้คลิก <strong>Grant admin consent for [Your Organization]</strong></li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_add_api_permissions.webp" alt="เพิ่มสิทธิ์ Microsoft API"></center>
<p><strong>ในตัวเชื่อมต่อ Logto Microsoft Entra ID:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณวางแผนจะจัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรชสำหรับการเข้าถึง API แบบยาวนาน</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Microsoft Graph ใช้ชื่อขอบเขตมาตรฐาน เช่น: <code>User.Read Mail.Read Calendars.Read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Microsoft Graph API และดำเนินการต่าง ๆ อย่าลืมเปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Logto Microsoft Entra ID ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-store-tokens-to-access-microsoft-apis-optional">ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-4-store-tokens-to-access-microsoft-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://docs.microsoft.com/en-us/graph/api/overview" target="_blank" rel="noopener noreferrer" class="link_hf7f">Microsoft Graph APIs<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องได้รับขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าการกำหนดค่าสิทธิ์ API ของ Microsoft Entra admin center และในตัวเชื่อมต่อ Microsoft Entra ID ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Microsoft Entra ID ของ Logto โดย Logto จะจัดเก็บโทเค็นการเข้าถึง (access token) และโทเค็นรีเฟรช (refresh token) ของ Microsoft อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่าโทเค็นรีเฟรช (refresh token) จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอปพลิเคชัน Microsoft Entra ID ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Microsoft Entra ID ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>domains</code> อีเมลขององค์กรของคุณในแท็บ <code>experience</code> ของตัวเชื่อมต่อ การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกจำกัดให้ใช้เฉพาะตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->ปลั๊กอิน WordPress<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-wordpress-plugin-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>microsoft-entra-id-oidc-enterprise-sso</category>
            <category>wordpress-plugin</category>
            <category>php</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Microsoft Entra ID OIDC enterprise SSO ด้วย iOS (Swift)]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://developer.apple.com/ios" target="_blank" rel="noopener">iOS (Swift)</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://developer.apple.com/ios" target="_blank" rel="noopener">iOS (Swift)</a></li>
<li class="">มีบัญชี <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Native app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Native app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Native app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->iOS (Swift)<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม iOS (Swift) กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม iOS (Swift) กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม iOS (Swift) กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="add-logto-sdk-as-a-dependency">เพิ่ม Logto SDK เป็น dependency<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#add-logto-sdk-as-a-dependency" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่ม Logto SDK เป็น dependency" title="ลิงก์ตรงไปยัง เพิ่ม Logto SDK เป็น dependency" translate="no">​</a></h3>
<p>ใช้ URL ต่อไปนี้เพื่อเพิ่ม Logto SDK เป็น dependency ใน Swift Package Manager</p>
<div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token plain">https://github.com/logto-io/swift.git</span><br></span></code></pre></div></div>
<p>ตั้งแต่ Xcode 11 เป็นต้นมา คุณสามารถ <span class="linkWrapper_B4Bt"><a href="https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app" target="_blank" rel="noopener noreferrer" class="link_hf7f">นำเข้า Swift package ได้โดยตรง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> โดยไม่ต้องใช้เครื่องมือเพิ่มเติมใด ๆ</p>
<p>ขณะนี้ เรายังไม่รองรับ <strong>Carthage</strong> และ <strong>CocoaPods</strong> เนื่องจากปัญหาทางเทคนิคบางประการ</p>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="carthage">Carthage<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#carthage" class="hash-link" aria-label="ลิงก์ตรงไปยัง Carthage" title="ลิงก์ตรงไปยัง Carthage" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><p>Carthage <span class="linkWrapper_B4Bt"><a href="https://github.com/Carthage/Carthage/issues/1226#issuecomment-290931385" target="_blank" rel="noopener noreferrer" class="link_hf7f">ต้องการไฟล์ <code>xcodeproj</code> เพื่อ build<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แต่ <code>swift package generate-xcodeproj</code> จะรายงานข้อผิดพลาด เนื่องจากเราใช้ binary targets สำหรับปลั๊กอินโซเชียลแบบ native เราจะพยายามหาวิธีแก้ไขในภายหลัง</p></div></div></details>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="cocoapods">CocoaPods<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#cocoapods" class="hash-link" aria-label="ลิงก์ตรงไปยัง CocoaPods" title="ลิงก์ตรงไปยัง CocoaPods" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><p>CocoaPods <span class="linkWrapper_B4Bt"><a href="https://github.com/CocoaPods/CocoaPods/issues/3276" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไม่รองรับ local dependency<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ monorepo ดังนั้นจึงยากที่จะสร้าง <code>.podspec</code> สำหรับ repo นี้</p></div></div></details>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>เริ่มต้นไคลเอนต์โดยการสร้างอินสแตนซ์ <code>LogtoClient</code> ด้วยอ็อบเจกต์ <code>LogtoConfig</code></p>
<div class="language-swift codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">ContentView.swift</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-swift codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token class-name">Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> config </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token operator">?</span><span class="token plain"> </span><span class="token class-name">LogtoConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"&lt;your-logto-endpoint&gt;"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// เช่น http://localhost:3001</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"&lt;your-app-id&gt;"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> client </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">useConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre></div></div>
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">ข้อมูล<!-- -->:</span><p>โดยปกติ เราจะจัดเก็บข้อมูลรับรอง เช่น โทเค็น ID (ID Token) และ โทเค็นรีเฟรช (Refresh Token) ไว้ใน Keychain ดังนั้นผู้ใช้จึงไม่จำเป็นต้องลงชื่อเข้าใช้อีกเมื่อกลับมา</p><p>หากต้องการปิดการทำงานนี้ ให้ตั้งค่า <code>usingPersistStorage</code> เป็น <code>false</code>:</p><div class="language-swift codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-swift codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> config </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token operator">?</span><span class="token plain"> </span><span class="token class-name">LogtoConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  usingPersistStorage</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="sign-in">ลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง ลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง ลงชื่อเข้าใช้" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันของ Logto Console เพิ่ม Redirect URI <code>io.logto://callback</code> แล้วคลิก "บันทึกการเปลี่ยนแปลง" (Save changes)</p>
<img alt="Redirect URI ใน Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/ios-redirect-uri.png" width="600px">
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">ข้อมูล<!-- -->:</span><p>Redirect URI ใน iOS SDK ใช้สำหรับการทำงานภายในเท่านั้น <em>ไม่จำเป็นต้อง</em> เพิ่ม <span class="linkWrapper_B4Bt"><a href="https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app" target="_blank" rel="noopener noreferrer" class="link_hf7f">Custom URL Scheme<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> จนกว่าจะมีตัวเชื่อมต่อร้องขอ</p></div></div></div>
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="sign-in-and-sign-out">การลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง การลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง การลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h4>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signInWithBrowser(redirectUri:)</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<p>คุณสามารถใช้ <code>client.signInWithBrowser(redirectUri:)</code> เพื่อให้ผู้ใช้ลงชื่อเข้าใช้ และ <code>client.signOut()</code> เพื่อออกจากระบบ</p>
<p>ตัวอย่างเช่น ในแอป SwiftUI:</p>
<div class="language-swift codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">ContentView.swift</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-swift codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">struct</span><span class="token plain"> </span><span class="token class-name">ContentView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token class-name">View</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token attribute atrule">@State</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token class-name">Bool</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">init</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    isAuthenticated </span><span class="token operator">=</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">isAuthenticated</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">some</span><span class="token plain"> </span><span class="token class-name">View</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token class-name">VStack</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token class-name">Button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"Sign Out"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token class-name">Task</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">self</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">else</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token class-name">Button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"Sign In"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token class-name">Task</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">self</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">do</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">signInWithBrowser</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUri</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> "$</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">                props</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">redirectUris</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token number">0</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token operator">??</span><span class="token plain"> 'io</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">logto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token operator">//</span><span class="token plain">callback'</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> error </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token class-name">LogtoClientErrors</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">SignIn</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token comment" style="color:rgb(98, 114, 164)">// เกิดข้อผิดพลาดระหว่างการลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token comment" style="color:rgb(98, 114, 164)">// ข้อผิดพลาดอื่น ๆ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->iOS (Swift)<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Azure AD SSO application<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" title="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-microsoft-entraid-oidc-application">ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#step-1-create-an-microsoft-entraid-oidc-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC" translate="no">​</a></h3>
<ol>
<li class="">
<p>ไปที่ <span class="linkWrapper_B4Bt"><a href="https://entra.microsoft.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Microsoft Entra admin center<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</p>
</li>
<li class="">
<p>ไปที่ Identity &gt; Applications &gt; App registrations</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_create_application.webp" alt="สร้างแอปพลิเคชัน"></center>
<ol start="3">
<li class="">
<p>เลือก <code>New registration</code></p>
</li>
<li class="">
<p>กรอกชื่อแอปพลิเคชันและเลือกประเภทบัญชีที่เหมาะสมสำหรับแอปของคุณ</p>
</li>
<li class="">
<p>เลือก <code>Web</code> เป็นแพลตฟอร์มของแอปพลิเคชัน</p>
</li>
<li class="">
<p>คัดลอกและวาง <code>redirect URI</code> จากหน้าการตั้งค่า SSO ของ Logto โดย <code>redirect URI</code> คือ URL ที่ผู้ใช้จะถูกเปลี่ยนเส้นทางไปหลังจากยืนยันตัวตนกับ Microsoft Entra ID แล้ว</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_config_application.webp" alt="กำหนดค่าแอปพลิเคชัน"></center>
<ol start="6">
<li class="">คลิก <code>Register</code> เพื่อสร้างแอปพลิเคชัน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-microsoft-entra-id-oidc-sso-at-logto">ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#step-2-configure-microsoft-entra-id-oidc-sso-at-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน Microsoft Entra OIDC สำเร็จแล้ว คุณจะต้องนำค่าการตั้งค่าของ IdP กลับมากำหนดใน Logto ให้ไปที่แท็บ <code>Connection</code> ใน Logto Console และกรอกค่าการตั้งค่าต่อไปนี้:</p>
<ol>
<li class=""><strong>Client ID</strong>: ตัวระบุเฉพาะที่ Microsoft Entra กำหนดให้กับแอป OIDC ของคุณ ตัวระบุตัวนี้ใช้โดย Logto เพื่อระบุและยืนยันตัวตนของแอปพลิเคชันระหว่างกระบวนการ OIDC คุณสามารถค้นหาได้ในหน้า overview ของแอปพลิเคชันในส่วน <code>Application (client) ID</code></li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_application_details.webp" alt="รายละเอียดแอปพลิเคชัน"></center>
<ol start="2">
<li class=""><strong>Client Secret</strong>: สร้าง client secret ใหม่และคัดลอกค่าที่ได้ไปใส่ใน Logto รหัสลับนี้ใช้สำหรับยืนยันตัวตนของแอป OIDC และรักษาความปลอดภัยในการสื่อสารระหว่าง Logto กับ IdP</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_create_secret.webp" alt="สร้าง Secret"></center>
<ol start="3">
<li class="">
<p><strong>ผู้ออก (Issuer)</strong>: URL ของผู้ออก ซึ่งเป็นตัวระบุเฉพาะของ IdP ที่ระบุที่ตั้งของผู้ให้บริการข้อมูลระบุตัวตน OIDC เป็นส่วนสำคัญของการตั้งค่า OIDC เพราะช่วยให้ Logto ค้นหา endpoint ที่จำเป็นได้</p>
<p>แทนที่จะต้องกรอก endpoint OIDC ทั้งหมดด้วยตนเอง Logto จะดึงค่าการตั้งค่าและ endpoint ของ IdP ที่จำเป็นทั้งหมดโดยอัตโนมัติ โดยใช้ issuer url ที่คุณให้ไว้และเรียกไปยัง discover endpoint ของ IdP</p>
<p>ในการรับ issuer URL คุณสามารถค้นหาได้ในส่วน <code>Endpoints</code> ของหน้า overview ของแอปพลิเคชัน</p>
<p>ค้นหา endpoint <code>OpenID Connect metadata document</code> และคัดลอก URL <strong>โดยไม่ต้อง</strong>ใส่ path ต่อท้าย <code>.well-known/openid-configuration</code> เนื่องจาก Logto จะเติม <code>.well-known/openid-configuration</code> ต่อท้าย issuer URL ให้อัตโนมัติเมื่อดึงค่าการตั้งค่า OIDC</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_endpoints.webp" alt="Endpoints"></center>
<ol start="4">
<li class=""><strong>ขอบเขต (Scope)</strong> (ไม่บังคับ): Logto จะเพิ่มขอบเขตที่จำเป็น (<code>openid</code>, <code>profile</code>, และ <code>email</code>) ในทุกคำขอโดยอัตโนมัติ คุณสามารถระบุขอบเขตเพิ่มเติมเป็นรายการที่คั่นด้วยช่องว่าง หากแอปของคุณต้องการสิทธิ์หรือระดับการเข้าถึงเพิ่มเติมจาก IdP</li>
</ol>
<p>คลิก <code>Save</code> เพื่อเสร็จสิ้นกระบวนการตั้งค่า</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-additional-scopes-optional">ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#step-3-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Microsoft Entra ID ของพวกเขาได้ การร้องขอสิทธิ์ Microsoft Graph ต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Microsoft Entra admin center:</strong></p>
<ol>
<li class="">ไปที่ <strong>Microsoft Entra ID &gt; App registrations</strong> และเลือกแอปพลิเคชันของคุณ</li>
<li class="">ไปที่ <strong>API permissions &gt; Add a permission &gt; Microsoft Graph &gt; Delegated permissions</strong></li>
<li class="">เลือกเฉพาะสิทธิ์ที่แอปของคุณต้องการ:<!-- -->
<ul>
<li class="">สิทธิ์ OpenID:<!-- -->
<ul>
<li class=""><code>openid</code> (จำเป็น) - ลงชื่อเข้าใช้ผู้ใช้</li>
<li class=""><code>profile</code> (จำเป็น) - ดูโปรไฟล์พื้นฐานของผู้ใช้</li>
<li class=""><code>email</code> (จำเป็น) - ดูที่อยู่อีเมลของผู้ใช้</li>
<li class=""><code>offline_access</code> (ไม่บังคับ) - ต้องใช้เฉพาะเมื่อคุณเปิดใช้งาน <span class="linkWrapper_B4Bt"><a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#step-4-store-tokens-to-access-microsoft-apis-optional" class="link_hf7f">จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</a></span> ในตัวเชื่อมต่อ Logto และต้องการรับโทเค็นรีเฟรช (Refresh token) เพื่อเข้าถึง Microsoft Graph APIs แบบยาวนาน</li>
</ul>
</li>
<li class="">การเข้าถึง API (ไม่บังคับ): เพิ่มสิทธิ์เพิ่มเติมที่แอปของคุณต้องการ สิทธิ์ Microsoft Graph ที่พบบ่อย เช่น <code>Mail.Read</code>, <code>Calendars.Read</code>, <code>Files.Read</code> เป็นต้น สามารถดู <span class="linkWrapper_B4Bt"><a href="https://docs.microsoft.com/en-us/graph/permissions-reference" target="_blank" rel="noopener noreferrer" class="link_hf7f">รายการสิทธิ์ของ Microsoft Graph<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อค้นหาสิทธิ์ที่มีให้ใช้งาน</li>
</ul>
</li>
<li class="">คลิก <strong>Add permissions</strong> เพื่อยืนยันการเลือก</li>
<li class="">หากแอปของคุณต้องการการยินยอมจากผู้ดูแลระบบสำหรับสิทธิ์บางรายการ ให้คลิก <strong>Grant admin consent for [Your Organization]</strong></li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_add_api_permissions.webp" alt="เพิ่มสิทธิ์ Microsoft API"></center>
<p><strong>ในตัวเชื่อมต่อ Logto Microsoft Entra ID:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณวางแผนจะจัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรชสำหรับการเข้าถึง API แบบยาวนาน</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Microsoft Graph ใช้ชื่อขอบเขตมาตรฐาน เช่น: <code>User.Read Mail.Read Calendars.Read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Microsoft Graph API และดำเนินการต่าง ๆ อย่าลืมเปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Logto Microsoft Entra ID ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-store-tokens-to-access-microsoft-apis-optional">ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#step-4-store-tokens-to-access-microsoft-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://docs.microsoft.com/en-us/graph/api/overview" target="_blank" rel="noopener noreferrer" class="link_hf7f">Microsoft Graph APIs<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องได้รับขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าการกำหนดค่าสิทธิ์ API ของ Microsoft Entra admin center และในตัวเชื่อมต่อ Microsoft Entra ID ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Microsoft Entra ID ของ Logto โดย Logto จะจัดเก็บโทเค็นการเข้าถึง (access token) และโทเค็นรีเฟรช (refresh token) ของ Microsoft อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่าโทเค็นรีเฟรช (refresh token) จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอปพลิเคชัน Microsoft Entra ID ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Microsoft Entra ID ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>domains</code> อีเมลขององค์กรของคุณในแท็บ <code>experience</code> ของตัวเชื่อมต่อ การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกจำกัดให้ใช้เฉพาะตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->iOS (Swift)<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-ios-swift-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>microsoft-entra-id-oidc-enterprise-sso</category>
            <category>ios-swift</category>
            <category>swift</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Microsoft Entra ID SAML enterprise SSO ด้วย Vanilla JS]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a></li>
<li class="">มีบัญชี <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->แอปหน้าเดียว (Single page app)<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vanilla JS<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vanilla JS กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">vanilla-js SDK เป็น <span class="linkWrapper_B4Bt"><a href="https://stackoverflow.com/questions/64725017/what-does-it-mean-by-framework-agnostic" target="_blank" rel="noopener noreferrer" class="link_hf7f">framework-agnostic<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คุณสามารถใช้กับเฟรมเวิร์กฝั่งหน้าเว็บใดก็ได้โดยเขียนตัวห่อ (wrapper) ให้เหมาะสม</li>
<li class="">โปรเจกต์ตัวอย่างมีให้ใน <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/browser-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<p>เลือกตัวจัดการแพ็กเกจที่คุณชื่นชอบ หรือใช้ CDN เพื่อติดตั้ง Logto Browser SDK</p>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">CDN</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขอบคุณ jsdelivr เป็นพิเศษ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">type</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">module</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript">  </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token script language-javascript"> </span><span class="token script language-javascript imports maybe-class-name">LogtoClient</span><span class="token script language-javascript"> </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token script language-javascript"> </span><span class="token script language-javascript string" style="color:rgb(255, 121, 198)">'https://cdn.jsdelivr.net/npm/@logto/browser@2.2.13/+esm'</span><span class="token script language-javascript punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและเริ่มต้นอินสแตนซ์ <code>LogtoClient</code> โดยส่ง config เข้าไป:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">index.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> LogtoClient </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/browser'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> logtoClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>คุณสามารถค้นหา <code>endpoint</code> และ <code>appId</code> ได้จากหน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-a-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-a-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีขั้นตอนที่ต้องดำเนินการหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการขั้นตอนนี้อย่างถูกต้องกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Callback.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">callbackHandler</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">handleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">href</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">!</span><span class="token plain">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้ไม่สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token function" style="color:rgb(80, 250, 123)">alert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'ลงชื่อเข้าใช้ไม่สำเร็จ'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">assign</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'/'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p><code>logtoClient</code> มีเมธอด <code>signIn</code> และ <code>signOut</code> เพื่อช่วยให้คุณจัดการกระบวนการการยืนยันตัวตน (Authentication) ได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Home.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มออกจากระบบ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">appendChild</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-authentication-status">จัดการสถานะการยืนยันตัวตน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-authentication-status" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" title="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" translate="no">​</a></h3>
<p>ใน Logto SDK โดยทั่วไปเราสามารถใช้ <code>logtoClient.isAuthenticated</code> เพื่อตรวจสอบสถานะการยืนยันตัวตน (authentication) หากผู้ใช้ลงชื่อเข้าใช้แล้ว ค่านี้จะเป็น <code>true</code> หากยังไม่ได้ลงชื่อเข้าใช้ ค่านี้จะเป็น <code>false</code></p>
<p>ในแอป vanilla JS ของคุณ คุณสามารถใช้สถานะ <code>isAuthenticated</code> เพื่อแสดงหรือซ่อนปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบอัตโนมัติ มาดูวิธีการทำกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> redirectUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> baseUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// การแสดงผลปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบมีเงื่อนไข</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">render</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> container </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">querySelector</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#container'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">baseUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  container</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">append</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vanilla JS<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Azure AD SSO application<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" title="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-azure-ad-sso-application">ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-1-create-an-azure-ad-sso-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Azure AD SSO" translate="no">​</a></h3>
<p>เริ่มต้นการผสานรวม Azure AD SSO โดยการสร้างแอปพลิเคชัน SSO ในฝั่ง Azure AD</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://portal.azure.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Azure portal<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">เลือกบริการ <code>Microsoft Entra ID</code></li>
<li class="">ไปที่ <code>Enterprise applications</code> โดยใช้เมนูด้านข้าง คลิก <code>New application</code> และเลือก <code>Create your own application</code></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_create_application.webp" alt="Azure AD create application">
<ol>
<li class="">กรอกชื่อแอปพลิเคชันและเลือก <code>Integrate any other application you don't find in the gallery (Non-gallery)</code></li>
<li class="">เลือก <code>Setup single sign-on</code> &gt; <code>SAML</code></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_set_up_single_sign_on.webp" alt="Azure AD set up SSO">
<ol>
<li class="">ทำตามคำแนะนำ โดยในขั้นตอนแรก คุณจะต้องกรอกการตั้งค่า SAML พื้นฐานโดยใช้ข้อมูลต่อไปนี้ที่ได้รับจาก Logto</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_sp_config.webp" alt="Azure AD SP config">
<ul>
<li class=""><strong>Audience URI (SP Entity ID)</strong>: ใช้เป็นตัวระบุที่ไม่ซ้ำกันทั่วโลกสำหรับบริการ Logto ของคุณ ทำหน้าที่เป็น EntityId สำหรับ SP ระหว่างคำขอการยืนยันตัวตน (Authentication request) ไปยัง IdP ตัวระบุตัวนี้มีความสำคัญต่อการแลกเปลี่ยนข้อมูล SAML assertion และข้อมูลที่เกี่ยวข้องกับการยืนยันตัวตนอื่น ๆ อย่างปลอดภัยระหว่าง IdP และ Logto</li>
<li class=""><strong>ACS URL</strong>: Assertion Consumer Service (ACS) URL คือที่อยู่ที่ SAML assertion จะถูกส่งมาด้วยคำขอแบบ POST URL นี้ถูกใช้โดย IdP เพื่อส่ง SAML assertion ไปยัง Logto โดยทำหน้าที่เป็น callback URL ที่ Logto คาดว่าจะได้รับและประมวลผล SAML response ที่มีข้อมูลตัวตนของผู้ใช้</li>
</ul>
<p>คลิก <code>Save</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-saml-sso-at-logto">ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-2-configure-saml-sso-at-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO ที่ Logto" translate="no">​</a></h3>
<p>เพื่อให้การเชื่อมต่อ SAML SSO ทำงานได้ คุณจะต้องนำข้อมูลเมตาของผู้ให้บริการข้อมูลระบุตัวตน (IdP) ส่งกลับไปยัง Logto มาสลับกลับมาที่ฝั่ง Logto และไปที่แท็บ <code>Connection</code> ของตัวเชื่อมต่อ Azure AD SSO ของคุณ</p>
<p>Logto มีวิธีการตั้งค่าข้อมูลเมตาของ IdP ให้เลือก 3 วิธี วิธีที่ง่ายที่สุดคือการระบุ <code>metadata URL</code> ของแอป Azure AD SSO</p>
<p>คัดลอก <code>App Federation Metadata Url</code> จากส่วน <code>SAML Certificates</code> ของแอป Azure AD SSO ของคุณ แล้ววางลงในช่อง <code>Metadata URL</code> ใน Logto</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_metadata_url.webp" alt="Azure AD Metadata URL">
<p>Logto จะดึงข้อมูลเมตาจาก URL ดังกล่าวและตั้งค่าการเชื่อมต่อ SAML SSO ให้อัตโนมัติ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-user-attributes-mapping">ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-3-configure-user-attributes-mapping" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าการแมปแอตทริบิวต์ผู้ใช้" translate="no">​</a></h3>
<p>Logto มีวิธีที่ยืดหยุ่นในการแมปแอตทริบิวต์ของผู้ใช้ที่ได้รับจากผู้ให้บริการข้อมูลระบุตัวตน (IdP) ไปยังแอตทริบิวต์ของผู้ใช้ใน Logto โดย Logto จะซิงค์แอตทริบิวต์ของผู้ใช้ต่อไปนี้จาก IdP โดยอัตโนมัติ:</p>
<ul>
<li class="">id: ตัวระบุที่ไม่ซ้ำของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (<code>nameID</code>) จาก SAML response เป็นรหัส SSO identity ของผู้ใช้</li>
<li class="">email: ที่อยู่อีเมลของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (<code>email</code>) จาก SAML response เป็นอีเมลหลักของผู้ใช้โดยค่าเริ่มต้น</li>
<li class="">name: ชื่อของผู้ใช้</li>
</ul>
<p>คุณสามารถจัดการตรรกะการแมปแอตทริบิวต์ของผู้ใช้ได้ทั้งฝั่ง Azure AD หรือฝั่ง Logto</p>
<ol>
<li class="">
<p>แมปแอตทริบิวต์ของผู้ใช้ AzureAD ไปยังแอตทริบิวต์ของผู้ใช้ Logto ที่ฝั่ง Logto</p>
<p>ไปที่ส่วน <code>Attributes &amp; Claims</code> ของแอป Azure AD SSO ของคุณ</p>
<p>คัดลอกชื่อแอตทริบิวต์ต่อไปนี้ (พร้อมคำนำหน้า namespace) แล้ววางลงในช่องที่เกี่ยวข้องใน Logto</p>
<ul>
<li class=""><code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</code></li>
<li class=""><code>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name</code> (คำแนะนำ: อัปเดตการแมปค่านี้เป็น <code>user.displayname</code> เพื่อประสบการณ์ผู้ใช้ที่ดียิ่งขึ้น)</li>
</ul>
</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_default_attribute_mapping.webp" alt="Azure AD default attribute mapping">
<ol>
<li class="">
<p>แมปแอตทริบิวต์ของผู้ใช้ AzureAD ไปยังแอตทริบิวต์ของผู้ใช้ Logto ที่ฝั่ง AzureAD</p>
<p>ไปที่ส่วน <code>Attributes &amp; Claims</code> ของแอป Azure AD SSO ของคุณ</p>
<p>คลิก <code>Edit</code> และอัปเดตช่อง <code>Additional claims</code> ตามการตั้งค่าแอตทริบิวต์ของผู้ใช้ Logto:</p>
<ul>
<li class="">อัปเดตค่าชื่อการอ้างสิทธิ์ตามการตั้งค่าแอตทริบิวต์ของผู้ใช้ Logto</li>
<li class="">ลบคำนำหน้า namespace ออก</li>
<li class="">คลิก <code>Save</code> เพื่อดำเนินการต่อ</li>
</ul>
<p>ควรได้การตั้งค่าดังนี้:</p>
</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_logto_attribute_mapping.webp" alt="Azure AD_Logto attribute mapping">
<p>คุณยังสามารถระบุแอตทริบิวต์ของผู้ใช้เพิ่มเติมที่ฝั่ง Azure AD ได้ Logto จะเก็บบันทึกแอตทริบิวต์ของผู้ใช้ต้นฉบับที่ได้รับจาก IdP ไว้ในฟิลด์ <code>sso_identity</code> ของผู้ใช้</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-assign-users-to-the-azure-ad-sso-application">ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-4-assign-users-to-the-azure-ad-sso-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดผู้ใช้ให้กับแอป Azure AD SSO" translate="no">​</a></h3>
<p>ไปที่ส่วน <code>Users and groups</code> ของแอปพลิเคชัน Azure AD SSO ของคุณ คลิกที่ <code>Add user/group</code> เพื่อกำหนดผู้ใช้ให้กับแอปพลิเคชัน Azure AD SSO เฉพาะผู้ใช้ที่ถูกกำหนดให้กับแอปพลิเคชัน Azure AD SSO ของคุณเท่านั้นที่จะสามารถยืนยันตัวตนผ่านตัวเชื่อมต่อ Azure AD SSO ได้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/azure_ad_assign_users.webp" alt="Azure AD assign users">
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SAML SSO เป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>โปรดตรวจสอบ <span class="linkWrapper_B4Bt"><a href="https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/add-application-portal-setup-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสารทางการของ Azure AD<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการเชื่อมต่อ Azure AD SSO</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vanilla JS<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Microsoft Entra ID SAML enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>microsoft-entra-id-saml-enterprise-sso</category>
            <category>vanilla-js</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง SAML enterprise SSO ด้วย Vanilla JS]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->SAML enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a></li>
<li class="">มีบัญชี <!-- -->SAML enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->แอปหน้าเดียว (Single page app)<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vanilla JS<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vanilla JS กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">vanilla-js SDK เป็น <span class="linkWrapper_B4Bt"><a href="https://stackoverflow.com/questions/64725017/what-does-it-mean-by-framework-agnostic" target="_blank" rel="noopener noreferrer" class="link_hf7f">framework-agnostic<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คุณสามารถใช้กับเฟรมเวิร์กฝั่งหน้าเว็บใดก็ได้โดยเขียนตัวห่อ (wrapper) ให้เหมาะสม</li>
<li class="">โปรเจกต์ตัวอย่างมีให้ใน <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/browser-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<p>เลือกตัวจัดการแพ็กเกจที่คุณชื่นชอบ หรือใช้ CDN เพื่อติดตั้ง Logto Browser SDK</p>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">CDN</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขอบคุณ jsdelivr เป็นพิเศษ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">type</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">module</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript">  </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token script language-javascript"> </span><span class="token script language-javascript imports maybe-class-name">LogtoClient</span><span class="token script language-javascript"> </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token script language-javascript"> </span><span class="token script language-javascript string" style="color:rgb(255, 121, 198)">'https://cdn.jsdelivr.net/npm/@logto/browser@2.2.13/+esm'</span><span class="token script language-javascript punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและเริ่มต้นอินสแตนซ์ <code>LogtoClient</code> โดยส่ง config เข้าไป:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">index.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> LogtoClient </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/browser'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> logtoClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>คุณสามารถค้นหา <code>endpoint</code> และ <code>appId</code> ได้จากหน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-a-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-a-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีขั้นตอนที่ต้องดำเนินการหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการขั้นตอนนี้อย่างถูกต้องกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Callback.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">callbackHandler</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">handleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">href</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">!</span><span class="token plain">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้ไม่สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token function" style="color:rgb(80, 250, 123)">alert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'ลงชื่อเข้าใช้ไม่สำเร็จ'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">assign</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'/'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p><code>logtoClient</code> มีเมธอด <code>signIn</code> และ <code>signOut</code> เพื่อช่วยให้คุณจัดการกระบวนการการยืนยันตัวตน (Authentication) ได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Home.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มออกจากระบบ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">appendChild</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-authentication-status">จัดการสถานะการยืนยันตัวตน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-authentication-status" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" title="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" translate="no">​</a></h3>
<p>ใน Logto SDK โดยทั่วไปเราสามารถใช้ <code>logtoClient.isAuthenticated</code> เพื่อตรวจสอบสถานะการยืนยันตัวตน (authentication) หากผู้ใช้ลงชื่อเข้าใช้แล้ว ค่านี้จะเป็น <code>true</code> หากยังไม่ได้ลงชื่อเข้าใช้ ค่านี้จะเป็น <code>false</code></p>
<p>ในแอป vanilla JS ของคุณ คุณสามารถใช้สถานะ <code>isAuthenticated</code> เพื่อแสดงหรือซ่อนปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบอัตโนมัติ มาดูวิธีการทำกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> redirectUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> baseUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// การแสดงผลปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบมีเงื่อนไข</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">render</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> container </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">querySelector</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#container'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">baseUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  container</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">append</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ SAML enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ SAML enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ SAML enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vanilla JS<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า SAML SSO application on your IdP<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า SAML SSO application on your IdP" title="ลิงก์ตรงไปยัง ตั้งค่า SAML SSO application on your IdP" translate="no">​</a></h2>
<p>ขั้นตอนที่ 1: สร้างแอปพลิเคชัน SAML SSO บน IdP ของคุณ {#step-1-create-a-saml-sso-application-on-your-idp}</p>
<p>เริ่มต้นการผสานรวม SAML Single Sign-On (SSO) โดยการสร้างแอปพลิเคชันในฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP). รับค่าการตั้งค่าต่อไปนี้จาก Logto ซึ่งแสดงถึง Service Provider (SP) ของคุณ:</p>
<ul>
<li class=""><strong>Audience URI (SP Entity ID)</strong>: ใช้เป็นตัวระบุที่ไม่ซ้ำกันทั่วโลกสำหรับบริการ Logto ของคุณ ทำหน้าที่เป็น EntityId สำหรับ SP ในระหว่างคำขอการยืนยันตัวตน (Authentication request) ไปยัง IdP. ตัวระบุตัวนี้มีความสำคัญต่อการแลกเปลี่ยนข้อมูล SAML assertion และข้อมูลที่เกี่ยวข้องกับการยืนยันตัวตนอื่น ๆ อย่างปลอดภัยระหว่าง IdP กับ Logto</li>
<li class=""><strong>ACS URL</strong>: Assertion Consumer Service (ACS) URL คือที่อยู่ที่ SAML assertion จะถูกส่งมาด้วยคำขอแบบ POST. URL นี้ใช้โดย IdP เพื่อส่ง SAML assertion มายัง Logto โดยทำหน้าที่เป็น callback URL ที่ Logto คาดว่าจะได้รับและประมวลผล SAML response ที่มีข้อมูลอัตลักษณ์ของผู้ใช้</li>
</ul>
<p>กรอกค่า Audience URI และ ACS URL ในแอป SAML ของ IdP ของคุณ และดำเนินการต่อเพื่อดึงค่าการตั้งค่าต่อไปนี้จาก IdP ของคุณ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-saml-sso-on-logto">ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-2-configure-saml-sso-on-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า SAML SSO บน Logto" translate="no">​</a></h3>
<p>เพื่อให้การเชื่อมต่อ SAML SSO ทำงานได้ คุณจะต้องให้ข้อมูลเมทาดาทาของผู้ให้บริการข้อมูลระบุตัวตน (IdP) กับ Logto เมทาดาทา IdP คือเอกสาร <span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/what-is-xml" target="_blank" rel="noopener noreferrer" class="link_hf7f">XML<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ที่มีข้อมูลทั้งหมดที่จำเป็นสำหรับ Logto ในการสร้างความเชื่อถือกับ IdP</p>
<p>ไปที่แท็บ <code>Connection</code> Logto มี 3 วิธีในการกำหนดค่าเมทาดาทา IdP ดังนี้:</p>
<ol>
<li class=""><strong>Metadata URL</strong>: ระบุ URL ของเอกสาร IdP metadata XML Logto จะดึงข้อมูลเมทาดาทาจาก URL และกำหนดค่า SAML SSO ให้อัตโนมัติ</li>
<li class=""><strong>Upload Metadata</strong>: อัปโหลดเอกสาร IdP metadata XML Logto จะวิเคราะห์เอกสาร XML และกำหนดค่า SAML SSO ให้อัตโนมัติ</li>
<li class=""><strong>Manual Configuration</strong>: กำหนดค่าเมทาดาทา IdP ด้วยตนเอง</li>
</ol>
<ul>
<li class="">IdP entity ID: Entity ID ของ IdP</li>
<li class="">Single sign-on URL: URL ของบริการ Single Sign-On ของ IdP</li>
<li class="">Signing certificate: ใบรับรอง x509 ใช้สำหรับตรวจสอบลายเซ็นของ SAML response ที่มาจาก IdP</li>
</ul>
<p>ไม่ว่าคุณจะเลือกวิธีใด Logto จะวิเคราะห์เมทาดาทา IdP และกำหนดค่า SAML SSO ให้สอดคล้องกัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-user-attributes-mapping">ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-3-configure-user-attributes-mapping" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: กำหนดการแมปแอตทริบิวต์ของผู้ใช้" translate="no">​</a></h3>
<p>แอตทริบิวต์ของผู้ใช้ที่ส่งกลับมาจาก IdP อาจแตกต่างกันไปขึ้นอยู่กับการตั้งค่าของ IdP Logto มีวิธีที่ยืดหยุ่นในการแมปแอตทริบิวต์ของผู้ใช้ที่ได้รับจาก IdP ไปยังแอตทริบิวต์ของผู้ใช้ใน Logto คุณสามารถกำหนดค่าการแมปแอตทริบิวต์ของผู้ใช้ได้ในแท็บประสบการณ์การผสานรวม SAML SSO</p>
<ul>
<li class="">id: ตัวระบุเฉพาะของผู้ใช้ Logto จะอ่านการอ้างสิทธิ์ (claim) <code>nameId</code> จาก SAML response เป็นรหัส SSO identity ของผู้ใช้</li>
<li class="">email: ที่อยู่อีเมลของผู้ใช้</li>
<li class="">name: ชื่อของผู้ใช้</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step4-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#step4-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO ให้เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SAML SSO เป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->SAML enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ SAML enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vanilla JS<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->SAML enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-saml-enterprise-sso-sign-in-with-vanilla-js-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>saml-enterprise-sso</category>
            <category>vanilla-js</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Microsoft Entra ID OIDC enterprise SSO ด้วย Vue]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue</a></li>
<li class="">มีบัญชี <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vue<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vue กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vue กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">Logto Vue SDK ถูกสร้างขึ้นด้วย composition API และใช้ composables ดังนั้นจึงรองรับเฉพาะ Vue 3 เท่านั้น</li>
<li class="">วิดีโอแนะนำมีให้รับชมบน <span class="linkWrapper_B4Bt"><a href="https://youtu.be/cAfsQrsGQqA" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">โปรเจกต์ตัวอย่างฉบับเต็มสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/vue-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository ของเรา<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/vue</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>createLogto</code> เพื่อติดตั้งปลั๊กอิน Logto:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">main.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> LogtoConfig </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> createApp </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> App </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'./App.vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// กำหนดค่าการเชื่อมต่อ Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> LogtoConfig </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> app </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">App</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">createLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">mount</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#app'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีสิ่งที่ต้องทำหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการให้ถูกต้องกัน</p>
<p>ก่อนอื่น สร้างหน้าคอลแบ็ก (callback) ดังนี้:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/CallbackView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> useHandleSignInCallback </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> router </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@/router'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขณะกำลังดำเนินการ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">isLoading</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">p</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>แทรกโค้ดด้านล่างในเส้นทาง <code>/callback</code> ของคุณ ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">router/index.ts</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ vue-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> router </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">createRouter</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  routes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      path</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      component</span><span class="token operator">:</span><span class="token plain"> CallbackView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี composable สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ที่ช่วยให้คุณจัดการโฟลว์การยืนยันตัวตนได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">views/HomeView.vue</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/vue'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ดึงฟังก์ชัน signIn, signOut และตัวแปร isAuthenticated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-if</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">!isAuthenticated</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignIn</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ลงชื่อเข้าใช้</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">v-else</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">@click</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">onClickSignOut</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain">ออกจากระบบ</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">template</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vue<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Azure AD SSO application<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" title="ลิงก์ตรงไปยัง ตั้งค่า Azure AD SSO application" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-microsoft-entraid-oidc-application">ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-1-create-an-microsoft-entraid-oidc-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอปพลิเคชัน Microsoft EntraID OIDC" translate="no">​</a></h3>
<ol>
<li class="">
<p>ไปที่ <span class="linkWrapper_B4Bt"><a href="https://entra.microsoft.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Microsoft Entra admin center<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</p>
</li>
<li class="">
<p>ไปที่ Identity &gt; Applications &gt; App registrations</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_create_application.webp" alt="สร้างแอปพลิเคชัน"></center>
<ol start="3">
<li class="">
<p>เลือก <code>New registration</code></p>
</li>
<li class="">
<p>กรอกชื่อแอปพลิเคชันและเลือกประเภทบัญชีที่เหมาะสมสำหรับแอปของคุณ</p>
</li>
<li class="">
<p>เลือก <code>Web</code> เป็นแพลตฟอร์มของแอปพลิเคชัน</p>
</li>
<li class="">
<p>คัดลอกและวาง <code>redirect URI</code> จากหน้าการตั้งค่า SSO ของ Logto โดย <code>redirect URI</code> คือ URL ที่ผู้ใช้จะถูกเปลี่ยนเส้นทางไปหลังจากยืนยันตัวตนกับ Microsoft Entra ID แล้ว</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_config_application.webp" alt="กำหนดค่าแอปพลิเคชัน"></center>
<ol start="6">
<li class="">คลิก <code>Register</code> เพื่อสร้างแอปพลิเคชัน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-microsoft-entra-id-oidc-sso-at-logto">ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-2-configure-microsoft-entra-id-oidc-sso-at-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า Microsoft Entra ID OIDC SSO ที่ Logto" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน Microsoft Entra OIDC สำเร็จแล้ว คุณจะต้องนำค่าการตั้งค่าของ IdP กลับมากำหนดใน Logto ให้ไปที่แท็บ <code>Connection</code> ใน Logto Console และกรอกค่าการตั้งค่าต่อไปนี้:</p>
<ol>
<li class=""><strong>Client ID</strong>: ตัวระบุเฉพาะที่ Microsoft Entra กำหนดให้กับแอป OIDC ของคุณ ตัวระบุตัวนี้ใช้โดย Logto เพื่อระบุและยืนยันตัวตนของแอปพลิเคชันระหว่างกระบวนการ OIDC คุณสามารถค้นหาได้ในหน้า overview ของแอปพลิเคชันในส่วน <code>Application (client) ID</code></li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_application_details.webp" alt="รายละเอียดแอปพลิเคชัน"></center>
<ol start="2">
<li class=""><strong>Client Secret</strong>: สร้าง client secret ใหม่และคัดลอกค่าที่ได้ไปใส่ใน Logto รหัสลับนี้ใช้สำหรับยืนยันตัวตนของแอป OIDC และรักษาความปลอดภัยในการสื่อสารระหว่าง Logto กับ IdP</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_create_secret.webp" alt="สร้าง Secret"></center>
<ol start="3">
<li class="">
<p><strong>ผู้ออก (Issuer)</strong>: URL ของผู้ออก ซึ่งเป็นตัวระบุเฉพาะของ IdP ที่ระบุที่ตั้งของผู้ให้บริการข้อมูลระบุตัวตน OIDC เป็นส่วนสำคัญของการตั้งค่า OIDC เพราะช่วยให้ Logto ค้นหา endpoint ที่จำเป็นได้</p>
<p>แทนที่จะต้องกรอก endpoint OIDC ทั้งหมดด้วยตนเอง Logto จะดึงค่าการตั้งค่าและ endpoint ของ IdP ที่จำเป็นทั้งหมดโดยอัตโนมัติ โดยใช้ issuer url ที่คุณให้ไว้และเรียกไปยัง discover endpoint ของ IdP</p>
<p>ในการรับ issuer URL คุณสามารถค้นหาได้ในส่วน <code>Endpoints</code> ของหน้า overview ของแอปพลิเคชัน</p>
<p>ค้นหา endpoint <code>OpenID Connect metadata document</code> และคัดลอก URL <strong>โดยไม่ต้อง</strong>ใส่ path ต่อท้าย <code>.well-known/openid-configuration</code> เนื่องจาก Logto จะเติม <code>.well-known/openid-configuration</code> ต่อท้าย issuer URL ให้อัตโนมัติเมื่อดึงค่าการตั้งค่า OIDC</p>
</li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_endpoints.webp" alt="Endpoints"></center>
<ol start="4">
<li class=""><strong>ขอบเขต (Scope)</strong> (ไม่บังคับ): Logto จะเพิ่มขอบเขตที่จำเป็น (<code>openid</code>, <code>profile</code>, และ <code>email</code>) ในทุกคำขอโดยอัตโนมัติ คุณสามารถระบุขอบเขตเพิ่มเติมเป็นรายการที่คั่นด้วยช่องว่าง หากแอปของคุณต้องการสิทธิ์หรือระดับการเข้าถึงเพิ่มเติมจาก IdP</li>
</ol>
<p>คลิก <code>Save</code> เพื่อเสร็จสิ้นกระบวนการตั้งค่า</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-additional-scopes-optional">ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-3-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Microsoft Entra ID ของพวกเขาได้ การร้องขอสิทธิ์ Microsoft Graph ต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Microsoft Entra admin center:</strong></p>
<ol>
<li class="">ไปที่ <strong>Microsoft Entra ID &gt; App registrations</strong> และเลือกแอปพลิเคชันของคุณ</li>
<li class="">ไปที่ <strong>API permissions &gt; Add a permission &gt; Microsoft Graph &gt; Delegated permissions</strong></li>
<li class="">เลือกเฉพาะสิทธิ์ที่แอปของคุณต้องการ:<!-- -->
<ul>
<li class="">สิทธิ์ OpenID:<!-- -->
<ul>
<li class=""><code>openid</code> (จำเป็น) - ลงชื่อเข้าใช้ผู้ใช้</li>
<li class=""><code>profile</code> (จำเป็น) - ดูโปรไฟล์พื้นฐานของผู้ใช้</li>
<li class=""><code>email</code> (จำเป็น) - ดูที่อยู่อีเมลของผู้ใช้</li>
<li class=""><code>offline_access</code> (ไม่บังคับ) - ต้องใช้เฉพาะเมื่อคุณเปิดใช้งาน <span class="linkWrapper_B4Bt"><a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-4-store-tokens-to-access-microsoft-apis-optional" class="link_hf7f">จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</a></span> ในตัวเชื่อมต่อ Logto และต้องการรับโทเค็นรีเฟรช (Refresh token) เพื่อเข้าถึง Microsoft Graph APIs แบบยาวนาน</li>
</ul>
</li>
<li class="">การเข้าถึง API (ไม่บังคับ): เพิ่มสิทธิ์เพิ่มเติมที่แอปของคุณต้องการ สิทธิ์ Microsoft Graph ที่พบบ่อย เช่น <code>Mail.Read</code>, <code>Calendars.Read</code>, <code>Files.Read</code> เป็นต้น สามารถดู <span class="linkWrapper_B4Bt"><a href="https://docs.microsoft.com/en-us/graph/permissions-reference" target="_blank" rel="noopener noreferrer" class="link_hf7f">รายการสิทธิ์ของ Microsoft Graph<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อค้นหาสิทธิ์ที่มีให้ใช้งาน</li>
</ul>
</li>
<li class="">คลิก <strong>Add permissions</strong> เพื่อยืนยันการเลือก</li>
<li class="">หากแอปของคุณต้องการการยินยอมจากผู้ดูแลระบบสำหรับสิทธิ์บางรายการ ให้คลิก <strong>Grant admin consent for [Your Organization]</strong></li>
</ol>
<center><img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/entra_id_oidc_add_api_permissions.webp" alt="เพิ่มสิทธิ์ Microsoft API"></center>
<p><strong>ในตัวเชื่อมต่อ Logto Microsoft Entra ID:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณวางแผนจะจัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรชสำหรับการเข้าถึง API แบบยาวนาน</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Microsoft Graph ใช้ชื่อขอบเขตมาตรฐาน เช่น: <code>User.Read Mail.Read Calendars.Read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Microsoft Graph API และดำเนินการต่าง ๆ อย่าลืมเปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Logto Microsoft Entra ID ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-store-tokens-to-access-microsoft-apis-optional">ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-4-store-tokens-to-access-microsoft-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง Microsoft APIs (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://docs.microsoft.com/en-us/graph/api/overview" target="_blank" rel="noopener noreferrer" class="link_hf7f">Microsoft Graph APIs<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องได้รับขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าการกำหนดค่าสิทธิ์ API ของ Microsoft Entra admin center และในตัวเชื่อมต่อ Microsoft Entra ID ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Microsoft Entra ID ของ Logto โดย Logto จะจัดเก็บโทเค็นการเข้าถึง (access token) และโทเค็นรีเฟรช (refresh token) ของ Microsoft อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่าโทเค็นรีเฟรช (refresh token) จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอปพลิเคชัน Microsoft Entra ID ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Microsoft Entra ID ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>domains</code> อีเมลขององค์กรของคุณในแท็บ <code>experience</code> ของตัวเชื่อมต่อ การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกจำกัดให้ใช้เฉพาะตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Microsoft Entra ID OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vue<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Microsoft Entra ID OIDC enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-microsoft-entra-id-oidc-enterprise-sso-sign-in-with-vue-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>microsoft-entra-id-oidc-enterprise-sso</category>
            <category>vue</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Okta enterprise SSO ด้วย React]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Okta enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://reactjs.org/" target="_blank" rel="noopener">React</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://reactjs.org/" target="_blank" rel="noopener">React</a></li>
<li class="">มีบัญชี <!-- -->Okta enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Single page app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Single page app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Single page app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->React<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม React กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม React กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม React กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">โปรเจกต์ตัวอย่างสามารถดูได้ที่ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/react-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
<li class="">วิดีโอแนะนำสามารถรับชมได้ที่ <span class="linkWrapper_B4Bt"><a href="https://youtu.be/pvKYt8QFppE" target="_blank" rel="noopener noreferrer" class="link_hf7f">ช่อง YouTube<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<!-- -->
<p>ติดตั้ง Logto SDK ผ่านตัวจัดการแพ็กเกจที่คุณชื่นชอบ:</p>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><pre><code class="language-bash">npm i <!-- -->@logto/react</code></pre></div><div role="tabpanel" class="tabItem_pED3" hidden=""><pre><code class="language-bash">pnpm add <!-- -->@logto/react</code></pre></div><div role="tabpanel" class="tabItem_pED3" hidden=""><pre><code class="language-bash">yarn add <!-- -->@logto/react</code></pre></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและใช้ <code>LogtoProvider</code> เพื่อให้บริบท Logto กับแอปของคุณ:</p>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">App.tsx</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> </span><span class="token imports maybe-class-name">LogtoProvider</span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token imports"> </span><span class="token imports maybe-class-name">LogtoConfig</span><span class="token imports"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/react'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> config</span><span class="token operator">:</span><span class="token plain"> </span><span class="token maybe-class-name">LogtoConfig</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// เช่น http://localhost:3001</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">App</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 121, 198)">LogtoProvider</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">config</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(248, 248, 242)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token tag script language-javascript" style="color:rgb(255, 121, 198)">config</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain-text">    </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 121, 198)">YourAppContent</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">/&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain-text">  </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag class-name" style="color:rgb(255, 121, 198)">LogtoProvider</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ Redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ Redirect" title="ลิงก์ตรงไปยัง จัดการ Redirect" translate="no">​</a></h3>
<p>เนื่องจากเราใช้ <code>http://localhost:3000/callback</code> เป็น redirect URI ตอนนี้เราจำเป็นต้องจัดการเส้นทางนี้อย่างถูกต้อง</p>
<p>ก่อนอื่น มาสร้างหน้าคอลแบ็กกันก่อน:</p>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Callback/index.tsx</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useHandleSignInCallback </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/react'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">Callback</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> isLoading </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useHandleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token comment" style="color:rgb(98, 114, 164)">// ทำบางอย่างเมื่อเสร็จสิ้น เช่น เปลี่ยนเส้นทางไปยังหน้าแรก</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ขณะกำลังดำเนินการ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">isLoading</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">div</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain-text">กำลังเปลี่ยนเส้นทาง...</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">div</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">null</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>สุดท้าย ใส่โค้ดด้านล่างเพื่อสร้าง route <code>/callback</code> ซึ่ง <strong>ไม่ต้องการการยืนยันตัวตน (authentication)</strong>:</p>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">App.tsx</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// สมมติว่าใช้ react-router</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag class-name" style="color:rgb(255, 121, 198)">Route</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">path</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">/callback</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">element</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(248, 248, 242)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token tag script language-javascript tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag script language-javascript tag class-name" style="color:rgb(255, 121, 198)">Callback</span><span class="token tag script language-javascript tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag script language-javascript tag punctuation" style="color:rgb(248, 248, 242)">/&gt;</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">/&gt;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p>เรามี hook สองตัวคือ <code>useHandleSignInCallback()</code> และ <code>useLogto()</code> ซึ่งช่วยให้คุณจัดการโฟลว์การยืนยันตัวตน (Authentication) ได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-tsx codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Home/index.tsx</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-tsx codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token imports"> useLogto </span><span class="token imports punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/react'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">Home</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">useLogto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">onClick</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(248, 248, 242)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token tag script language-javascript" style="color:rgb(255, 121, 198)">signOut</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain-text">Sign Out</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">onClick</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(248, 248, 242)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token tag script language-javascript" style="color:rgb(255, 121, 198)"> </span><span class="token tag script language-javascript arrow operator" style="color:rgb(255, 121, 198)">=&gt;</span><span class="token tag script language-javascript" style="color:rgb(255, 121, 198)"> </span><span class="token tag script language-javascript function" style="color:rgb(80, 250, 123)">signIn</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token tag script language-javascript string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token tag script language-javascript punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain-text">Sign In</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">button</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Okta enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->React<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-okta-admin-portal">ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#step-1-create-an-oidc-application-on-okta-admin-portal" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" translate="no">​</a></h3>
<ul>
<li class="">ไปที่พอร์ทัลผู้ดูแลระบบ Okta และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">ไปที่หน้า <code>Applications</code> / <code>Applications</code> โดยใช้เมนูด้านข้าง</li>
<li class="">คลิกปุ่ม <code>Create App Integration</code> เพื่อสร้างแอป OIDC ใหม่</li>
<li class="">เลือกตัวเลือก <code>OIDC - OpenID Connect</code> เป็น <code>Sign-in method</code></li>
<li class="">เลือกตัวเลือก <code>Web Application</code> เป็น <code>Application type</code></li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_create_application.webp" alt="สร้างแอปพลิเคชัน Okta">
<p>คลิกปุ่ม <code>Next</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-the-application-settings">ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#step-2-configure-the-application-settings" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" translate="no">​</a></h3>
<ol>
<li class="">กำหนด <code>App integration name</code> ซึ่งจะใช้เป็นตัวระบุของแอปพลิเคชัน OIDC ของคุณ</li>
<li class="">เพิ่ม <code>Sign-in redirect URIs</code> ใหม่โดยใช้ callback URL ของตัวเชื่อมต่อ Logto SSO</li>
</ol>
<p>นี่คือ URI ที่ Okta จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตน (Authentication) สำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI ที่กำหนดนี้พร้อมกับรหัสการอนุญาต (authorization code) Logto จะดำเนินการยืนยันตัวตน (Authentication) ให้สมบูรณ์โดยอิงจากรหัสการอนุญาตที่ได้รับจาก URI นี้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_application_settings.webp" alt="การตั้งค่าแอปพลิเคชัน Okta">
<ol start="3">
<li class="">กำหนดผู้ใช้ให้กับแอปพลิเคชัน</li>
</ol>
<p>ตามการตั้งค่า <code>Assignments</code> คุณสามารถเลือกกำหนดแอปพลิเคชันให้กับผู้ใช้ทั้งหมด หรือเฉพาะผู้ใช้ / กลุ่มที่ต้องการ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_assign_users.webp" alt="Okta assign users">
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าแอปพลิเคชัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#step-3-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC สำเร็จแล้ว คุณจะถูกเปลี่ยนเส้นทางไปยังหน้ารายละเอียดของแอปพลิเคชัน</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_client_credentials.webp" alt="Okta client credentials">
<p>คัดลอก <code>client ID</code> และ <code>client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ใช้โดเมน Okta ของคุณเป็น <code>issuer</code> ตัวอย่าง: <code>https://dev-12345678.okta.com</code> เมื่อกรอกข้อมูลครบทุกช่องแล้ว ให้คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าตัวเชื่อมต่อ</p>
<p>หากลิงก์ <code>issuer</code> ที่คุณให้มาถูกต้อง คุณจะเห็นรายการการตั้งค่า Okta IdP ที่ถูกแยกแสดงแบบเต็มด้านล่างช่อง <code>issuer</code></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-additional-scopes-optional">ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#step-4-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Okta ของพวกเขาได้ การร้องขอสิทธิ์ Okta เพิ่มเติมจำเป็นต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Okta admin console:</strong></p>
<ol>
<li class="">ไปที่ <strong>Applications &gt; Applications</strong> และเลือกแอป OIDC ของคุณ</li>
<li class="">ไปที่แท็บ <strong>Assignments</strong> เพื่อให้แน่ใจว่าแอปของคุณสามารถเข้าถึงผู้ใช้และกลุ่มที่ต้องการได้</li>
<li class="">สำหรับขอบเขตแบบกำหนดเอง ให้ไปที่ <strong>Security &gt; API &gt; Authorization Servers</strong> และเลือก authorization server ของคุณ</li>
<li class="">เพิ่มขอบเขตแบบกำหนดเองหากจำเป็น:<!-- -->
<ul>
<li class="">คลิก <strong>Scopes</strong> แล้วเลือก <strong>Add Scope</strong></li>
<li class="">กำหนดชื่อขอบเขต เช่น <code>okta.users.read</code> หรือ <code>okta.groups.read</code> สำหรับการเข้าถึง Okta APIs</li>
<li class="">กำหนดข้อกำหนดการขอความยินยอม (consent) สำหรับแต่ละขอบเขต</li>
</ul>
</li>
</ol>
<p>สำหรับรายการขอบเขตที่มีทั้งหมดและคำอธิบาย โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/api/openapi/okta-oauth/guides/overview/#scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสาร Okta OIDC<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ใน Logto Okta connector:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณต้องการจัดเก็บโทเค็นเพื่อเข้าถึง API แบบถาวร ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรช (Refresh token) สำหรับการเข้าถึง API ระยะยาว</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Okta เช่น <code>okta.users.read okta.groups.read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Okta APIs และดำเนินการต่าง ๆ โปรดตรวจสอบให้แน่ใจว่าได้เปิดใช้งาน <strong>Store tokens for persistent API access</strong> ใน Logto Okta connector ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-store-tokens-to-access-okta-apis-optional">ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#step-5-store-tokens-to-access-okta-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/guides/request-user-consent/main/#enable-consent-for-scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">Okta scopes<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต (scopes) เฉพาะและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าตั้งค่าสิทธิ์ API ของ Okta developer console และในตัวเชื่อมต่อ Okta ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API แบบถาวร</strong> ในตัวเชื่อมต่อ Okta ของ Logto โดย Logto จะจัดเก็บ Okta access และ refresh tokens อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่า refresh tokens จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอป Okta ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Okta ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#step-6-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการสร้างการเชื่อมต่อ OIDC กับ Okta โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://help.okta.com/oie/en-us/content/topics/apps/apps_app_integration_wizard_oidc.htm" target="_blank" rel="noopener noreferrer" class="link_hf7f">Create OIDC App Integrations<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Okta enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->React<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Okta enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-react-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>okta-enterprise-sso</category>
            <category>react</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Google Workspace enterprise SSO ด้วย Vanilla JS]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Google Workspace enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a></li>
<li class="">มีบัญชี <!-- -->Google Workspace enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->แอปหน้าเดียว (Single page app)<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vanilla JS<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vanilla JS กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">vanilla-js SDK เป็น <span class="linkWrapper_B4Bt"><a href="https://stackoverflow.com/questions/64725017/what-does-it-mean-by-framework-agnostic" target="_blank" rel="noopener noreferrer" class="link_hf7f">framework-agnostic<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คุณสามารถใช้กับเฟรมเวิร์กฝั่งหน้าเว็บใดก็ได้โดยเขียนตัวห่อ (wrapper) ให้เหมาะสม</li>
<li class="">โปรเจกต์ตัวอย่างมีให้ใน <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/browser-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<p>เลือกตัวจัดการแพ็กเกจที่คุณชื่นชอบ หรือใช้ CDN เพื่อติดตั้ง Logto Browser SDK</p>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">CDN</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขอบคุณ jsdelivr เป็นพิเศษ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">type</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">module</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript">  </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token script language-javascript"> </span><span class="token script language-javascript imports maybe-class-name">LogtoClient</span><span class="token script language-javascript"> </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token script language-javascript"> </span><span class="token script language-javascript string" style="color:rgb(255, 121, 198)">'https://cdn.jsdelivr.net/npm/@logto/browser@2.2.13/+esm'</span><span class="token script language-javascript punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและเริ่มต้นอินสแตนซ์ <code>LogtoClient</code> โดยส่ง config เข้าไป:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">index.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> LogtoClient </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/browser'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> logtoClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>คุณสามารถค้นหา <code>endpoint</code> และ <code>appId</code> ได้จากหน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-a-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-a-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีขั้นตอนที่ต้องดำเนินการหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการขั้นตอนนี้อย่างถูกต้องกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Callback.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">callbackHandler</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">handleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">href</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">!</span><span class="token plain">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้ไม่สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token function" style="color:rgb(80, 250, 123)">alert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'ลงชื่อเข้าใช้ไม่สำเร็จ'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">assign</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'/'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p><code>logtoClient</code> มีเมธอด <code>signIn</code> และ <code>signOut</code> เพื่อช่วยให้คุณจัดการกระบวนการการยืนยันตัวตน (Authentication) ได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Home.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มออกจากระบบ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">appendChild</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-authentication-status">จัดการสถานะการยืนยันตัวตน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-authentication-status" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" title="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" translate="no">​</a></h3>
<p>ใน Logto SDK โดยทั่วไปเราสามารถใช้ <code>logtoClient.isAuthenticated</code> เพื่อตรวจสอบสถานะการยืนยันตัวตน (authentication) หากผู้ใช้ลงชื่อเข้าใช้แล้ว ค่านี้จะเป็น <code>true</code> หากยังไม่ได้ลงชื่อเข้าใช้ ค่านี้จะเป็น <code>false</code></p>
<p>ในแอป vanilla JS ของคุณ คุณสามารถใช้สถานะ <code>isAuthenticated</code> เพื่อแสดงหรือซ่อนปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบอัตโนมัติ มาดูวิธีการทำกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> redirectUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> baseUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// การแสดงผลปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบมีเงื่อนไข</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">render</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> container </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">querySelector</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#container'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">baseUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  container</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">append</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Google Workspace enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vanilla JS<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า Google Cloud Platform<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า Google Cloud Platform" title="ลิงก์ตรงไปยัง ตั้งค่า Google Cloud Platform" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-a-new-project-on-google-cloud-platform">ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-1-create-a-new-project-on-google-cloud-platform" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างโปรเจกต์ใหม่บน Google Cloud Platform" translate="no">​</a></h3>
<p>ก่อนที่คุณจะสามารถใช้ Google Workspace เป็นผู้ให้บริการการยืนยันตัวตน (authentication provider) ได้ คุณต้องตั้งค่าโปรเจกต์ใน <span class="linkWrapper_B4Bt"><a href="https://console.developers.google.com/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google API Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อขอรับข้อมูลประจำตัว OAuth 2.0 หากคุณมีโปรเจกต์อยู่แล้ว สามารถข้ามขั้นตอนนี้ได้ หากยังไม่มี ให้สร้างโปรเจกต์ใหม่ภายใต้องค์กร Google ของคุณ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-config-the-consent-screen-for-your-application">ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-2-config-the-consent-screen-for-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าหน้าขอความยินยอม (consent screen) สำหรับแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>เพื่อสร้างข้อมูลรับรอง OIDC ใหม่ คุณต้องกำหนดค่าหน้าขอความยินยอม (Consent Screen) สำหรับแอปพลิเคชันของคุณ</p>
<ol>
<li class="">ไปที่หน้า <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/credentials/consent" target="_blank" rel="noopener noreferrer" class="link_hf7f">OAuth consent screen<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และเลือกประเภทผู้ใช้ <code>Internal</code> การตั้งค่านี้จะทำให้แอป OAuth สามารถใช้งานได้เฉพาะผู้ใช้ภายในองค์กรของคุณเท่านั้น</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_user_type.webp" alt="ประเภทผู้ใช้ในหน้าขอความยินยอมของ Google Workspace">
<ol start="2">
<li class="">กรอกการตั้งค่า <code>Consent Screen</code> ตามคำแนะนำบนหน้า คุณต้องระบุข้อมูลขั้นต่ำดังต่อไปนี้:</li>
</ol>
<ul>
<li class=""><strong>ชื่อแอปพลิเคชัน (Application name)</strong>: ชื่อของแอปพลิเคชันของคุณ ซึ่งจะแสดงบนหน้าขอความยินยอม</li>
<li class=""><strong>อีเมลสำหรับติดต่อ (Support email)</strong>: อีเมลสำหรับติดต่อของแอปพลิเคชัน ซึ่งจะแสดงบนหน้าขอความยินยอม</li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_settings.webp" alt="การตั้งค่าหน้าขอความยินยอมของ Google Workspace">
<ol start="3">
<li class="">กำหนด <code>ขอบเขต (Scopes)</code> สำหรับแอปพลิเคชันของคุณ เพื่อดึงข้อมูลตัวตนและอีเมลของผู้ใช้อย่างถูกต้องจาก IdP ตัวเชื่อมต่อ SSO ของ Logto จำเป็นต้องขอขอบเขตต่อไปนี้จาก IdP:</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_consent_screen_scopes.webp" alt="ขอบเขตในหน้าขอความยินยอมของ Google Workspace">
<ul>
<li class=""><strong>openid</strong>: ขอบเขตนี้จำเป็นสำหรับการยืนยันตัวตน OIDC ใช้สำหรับดึงโทเค็น ID (ID token) และเข้าถึง endpoint userInfo ของ IdP</li>
<li class=""><strong>profile</strong>: ขอบเขตนี้จำเป็นสำหรับการเข้าถึงข้อมูลโปรไฟล์พื้นฐานของผู้ใช้</li>
<li class=""><strong>email</strong>: ขอบเขตนี้จำเป็นสำหรับการเข้าถึงที่อยู่อีเมลของผู้ใช้</li>
</ul>
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าหน้าขอความยินยอม</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-create-a-new-oauth-credential">ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-3-create-a-new-oauth-credential" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: สร้างข้อมูลประจำตัว OAuth ใหม่" translate="no">​</a></h3>
<p>ไปที่หน้า <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener noreferrer" class="link_hf7f">Credentials<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม <code>Create Credentials</code> จากนั้นเลือกตัวเลือก <code>OAuth client ID</code> จากเมนูดรอปดาวน์เพื่อสร้าง OAuth credential ใหม่สำหรับแอปพลิเคชันของคุณ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_create_credentials.webp" alt="Google Workspace create credentials">
<p>ดำเนินการตั้งค่า OAuth credential ต่อโดยกรอกข้อมูลดังต่อไปนี้:</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_credentials_config.webp" alt="Google Workspace credentials config">
<ol>
<li class="">เลือก <code>Web application</code> เป็นประเภทของแอปพลิเคชัน</li>
<li class="">กรอก <code>Name</code> ของแอปพลิเคชันลูกข่ายของคุณ เช่น <code>Logto SSO Connector</code> เพื่อช่วยให้คุณระบุ credential นี้ได้ในอนาคต</li>
<li class="">กรอก <code>Authorized redirect URIs</code> ด้วย Logto callback URI นี่คือ URI ที่ Google จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตนสำเร็จ หลังจากผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI นี้พร้อมกับ authorization code Logto จะดำเนินการยืนยันตัวตนให้สมบูรณ์โดยอิงจาก authorization code ที่ได้รับจาก URI นี้</li>
<li class="">กรอก <code>Authorized JavaScript origins</code> ด้วย origin ของ Logto callback URI เพื่อให้แน่ใจว่าเฉพาะแอป Logto ของคุณเท่านั้นที่สามารถส่งคำขอไปยัง Google OAuth server ได้</li>
<li class="">คลิกปุ่ม <code>Create</code> เพื่อสร้าง OAuth credential</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-4-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ตั้งค่าตัวเชื่อมต่อ Logto ด้วยข้อมูลประจำตัวของไคลเอนต์" translate="no">​</a></h3>
<p>หลังจากสร้างข้อมูลประจำตัว OAuth สำเร็จแล้ว คุณจะได้รับหน้าต่างแจ้งเตือนที่แสดง client ID และ client secret</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/google_workspace_create_credentials.webp" alt="Google Workspace create credentials">
<p>คัดลอก <code>Client ID</code> และ <code>Client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ขณะนี้คุณได้ตั้งค่าตัวเชื่อมต่อ Google Workspace SSO บน Logto สำเร็จแล้ว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-additional-scopes-optional">ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-5-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: ขอบเขตเพิ่มเติม (Optional)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Google Workspace ของพวกเขาได้ การร้องขอสิทธิ์ของ Google จำเป็นต้องมีการตั้งค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Google Cloud Console:</strong></p>
<ol>
<li class="">ไปที่ <strong>APIs &amp; Services &gt; OAuth consent screen &gt; Scopes</strong></li>
<li class="">คลิก <strong>Add or Remove Scopes</strong> และเลือกเฉพาะขอบเขตที่แอปของคุณต้องการ:<!-- -->
<ul>
<li class="">การยืนยันตัวตน (Authentication) (จำเป็น):<!-- -->
<ul>
<li class=""><code>https://www.googleapis.com/auth/userinfo.email</code></li>
<li class=""><code>https://www.googleapis.com/auth/userinfo.profile</code></li>
<li class=""><code>openid</code></li>
</ul>
</li>
<li class="">การเข้าถึง API (ไม่บังคับ): เพิ่มขอบเขตเพิ่มเติมที่แอปของคุณต้องการ (เช่น Drive, Calendar, YouTube) ค้นหาบริการที่มีได้ใน <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/library" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google API Library<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> หากแอปของคุณต้องการเข้าถึง Google API เกินกว่าสิทธิ์พื้นฐาน ให้เปิดใช้งาน API เฉพาะที่แอปของคุณจะใช้ก่อน (เช่น Google Drive API, Gmail API, Calendar API) ใน Google API Library</li>
</ul>
</li>
<li class="">คลิก <strong>Update</strong> เพื่อยืนยันการเลือก</li>
<li class="">คลิก <strong>Save and Continue</strong> เพื่อบันทึกการเปลี่ยนแปลง</li>
</ol>
<p><strong>ในตัวเชื่อมต่อ Google Workspace ของ Logto:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลเอกลักษณ์ผู้ใช้พื้นฐาน คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Google โดยใช้ URL ขอบเขตแบบเต็ม ตัวอย่างเช่น: <code>https://www.googleapis.com/auth/calendar.readonly</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Google API และดำเนินการต่าง ๆ โปรดเปิดใช้งาน <strong>Store tokens for persistent API access</strong> ในตัวเชื่อมต่อ Google ของ Logto ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-store-tokens-to-access-google-apis-optional">ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-6-store-tokens-to-access-google-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: จัดเก็บโทเค็นเพื่อเข้าถึง Google APIs (Optional)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://console.cloud.google.com/apis/library" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google APIs<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่ต้องการในหน้าการตั้งค่าความยินยอม OAuth ของ Google Cloud Console และในตัวเชื่อมต่อ Google ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง</strong> ในตัวเชื่อมต่อ Google ของ Logto Logto จะจัดเก็บโทเค็นการเข้าถึง Google และโทเค็นรีเฟรช Google ไว้อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่าจะได้รับโทเค็นรีเฟรช ให้ตั้งค่าตัวเชื่อมต่อ Google ของ Logto ให้เปิดใช้งาน <strong>Offline Access</strong></li>
</ol>
<div class="theme-admonition theme-admonition-warning admonition_Gfwi alert alert--warning"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">คำเตือน<!-- -->:</span><p>คุณไม่จำเป็นต้องเพิ่ม <code>offline_access</code> ในช่อง <code>Scope</code> ของ Logto — การเพิ่มอาจทำให้เกิดข้อผิดพลาด Google จะใช้ <code>access_type=offline</code> โดยอัตโนมัติเมื่อเปิดใช้งาน offline access</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-7-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-7-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 7: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับข้อมูลเพิ่มเติมเกี่ยวกับตัวเชื่อมต่อ Google Workspace SSO โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developers.google.com/identity/openid-connect/openid-connect" target="_blank" rel="noopener noreferrer" class="link_hf7f">Google OpenID Connector<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Google Workspace enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Google Workspace enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vanilla JS<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Google Workspace enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-google-workspace-enterprise-sso-sign-in-with-vanilla-js-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>google-workspace-enterprise-sso</category>
            <category>vanilla-js</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง OIDC enterprise SSO ด้วย Vanilla JS]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->OIDC enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://en.wikipedia.org/wiki/ECMAScript" target="_blank" rel="noopener">Vanilla JS</a></li>
<li class="">มีบัญชี <!-- -->OIDC enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->แอปหน้าเดียว (Single page app)<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->แอปหน้าเดียว (Single page app)<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->Vanilla JS<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม Vanilla JS กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม Vanilla JS กับ Logto" translate="no">​</a></h2>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><ul>
<li class="">vanilla-js SDK เป็น <span class="linkWrapper_B4Bt"><a href="https://stackoverflow.com/questions/64725017/what-does-it-mean-by-framework-agnostic" target="_blank" rel="noopener noreferrer" class="link_hf7f">framework-agnostic<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คุณสามารถใช้กับเฟรมเวิร์กฝั่งหน้าเว็บใดก็ได้โดยเขียนตัวห่อ (wrapper) ให้เหมาะสม</li>
<li class="">โปรเจกต์ตัวอย่างมีให้ใน <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/js/tree/master/packages/browser-sample" target="_blank" rel="noopener noreferrer" class="link_hf7f">SDK repository<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ของเรา</li>
</ul></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="installation">การติดตั้ง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#installation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การติดตั้ง" title="ลิงก์ตรงไปยัง การติดตั้ง" translate="no">​</a></h3>
<p>เลือกตัวจัดการแพ็กเกจที่คุณชื่นชอบ หรือใช้ CDN เพื่อติดตั้ง Logto Browser SDK</p>
<div class="theme-tabs-container tabs-container tabList_eWY1"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_aDBZ tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">pnpm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_aDBZ">CDN</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_pED3"><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> i @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">pnpm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @logto/browser</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_pED3" hidden=""><div class="language-html codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-html codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">&lt;!-- ขอบคุณ jsdelivr เป็นพิเศษ --&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag" style="color:rgb(255, 121, 198)"> </span><span class="token tag attr-name" style="color:rgb(241, 250, 140)">type</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(248, 248, 242)">=</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag attr-value" style="color:rgb(255, 121, 198)">module</span><span class="token tag attr-value punctuation" style="color:rgb(248, 248, 242)">"</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript">  </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token script language-javascript"> </span><span class="token script language-javascript imports maybe-class-name">LogtoClient</span><span class="token script language-javascript"> </span><span class="token script language-javascript keyword module" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token script language-javascript"> </span><span class="token script language-javascript string" style="color:rgb(255, 121, 198)">'https://cdn.jsdelivr.net/npm/@logto/browser@2.2.13/+esm'</span><span class="token script language-javascript punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token script language-javascript"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token script language-javascript"></span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&lt;/</span><span class="token tag" style="color:rgb(255, 121, 198)">script</span><span class="token tag punctuation" style="color:rgb(248, 248, 242)">&gt;</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>นำเข้าและเริ่มต้นอินสแตนซ์ <code>LogtoClient</code> โดยส่ง config เข้าไป:</p>
<div class="language-ts codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">index.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-ts codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> LogtoClient </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'@logto/browser'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> logtoClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-logto-endpoint&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'&lt;your-application-id&gt;'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>คุณสามารถค้นหา <code>endpoint</code> และ <code>appId</code> ได้จากหน้ารายละเอียดแอปพลิเคชันใน Logto Console</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-a-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-a-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า redirect URIs<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" title="ลิงก์ตรงไปยัง กำหนดค่า redirect URIs" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ในตัวอย่างโค้ดต่อไปนี้ เราถือว่าแอปของคุณกำลังทำงานอยู่ที่ <code>http://localhost:3000/</code></p></div></div></div>
<!-- -->
<!-- -->
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uris">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#configure-redirect-uris" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันใน Logto Console เพิ่ม redirect URI <code>http://localhost:3000/callback</code></p>
<img alt="Redirect URI in Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/web-redirect-uri.png" width="600px">
<p>เช่นเดียวกับการลงชื่อเข้าใช้ ผู้ใช้ควรถูกเปลี่ยนเส้นทางไปที่ Logto เพื่อออกจากเซสชันที่ใช้ร่วมกัน เมื่อเสร็จสิ้นแล้ว ควรเปลี่ยนเส้นทางผู้ใช้กลับไปยังเว็บไซต์ของคุณ ตัวอย่างเช่น เพิ่ม <code>http://localhost:3000/</code> ในส่วน post sign-out redirect URI</p>
<p>จากนั้นคลิก "Save" เพื่อบันทึกการเปลี่ยนแปลง</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-redirect">จัดการ redirect<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-redirect" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการ redirect" title="ลิงก์ตรงไปยัง จัดการ redirect" translate="no">​</a></h3>
<p>ยังมีขั้นตอนที่ต้องดำเนินการหลังจากที่ผู้ใช้ถูกเปลี่ยนเส้นทางกลับมายังแอปพลิเคชันของคุณจาก Logto มาจัดการขั้นตอนนี้อย่างถูกต้องกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Callback.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">callbackHandler</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">handleSignInCallback</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">href</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">!</span><span class="token plain">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้ไม่สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token function" style="color:rgb(80, 250, 123)">alert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'ลงชื่อเข้าใช้ไม่สำเร็จ'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// จัดการกรณีลงชื่อเข้าใช้สำเร็จ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">window</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">location</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">assign</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'/'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="implement-sign-in-and-sign-out">สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#implement-sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง สร้างฟังก์ชันลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h3>
<p><code>logtoClient</code> มีเมธอด <code>signIn</code> และ <code>signOut</code> เพื่อช่วยให้คุณจัดการกระบวนการการยืนยันตัวตน (Authentication) ได้อย่างง่ายดาย</p>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signIn()</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">pages/Home.js</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// ฟังก์ชันสำหรับคลิกปุ่มออกจากระบบ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">appendChild</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<p>การเรียกใช้ <code>.signOut()</code> จะล้างข้อมูล Logto ทั้งหมดในหน่วยความจำและ localStorage หากมีอยู่</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="handle-authentication-status">จัดการสถานะการยืนยันตัวตน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#handle-authentication-status" class="hash-link" aria-label="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" title="ลิงก์ตรงไปยัง จัดการสถานะการยืนยันตัวตน" translate="no">​</a></h3>
<p>ใน Logto SDK โดยทั่วไปเราสามารถใช้ <code>logtoClient.isAuthenticated</code> เพื่อตรวจสอบสถานะการยืนยันตัวตน (authentication) หากผู้ใช้ลงชื่อเข้าใช้แล้ว ค่านี้จะเป็น <code>true</code> หากยังไม่ได้ลงชื่อเข้าใช้ ค่านี้จะเป็น <code>false</code></p>
<p>ในแอป vanilla JS ของคุณ คุณสามารถใช้สถานะ <code>isAuthenticated</code> เพื่อแสดงหรือซ่อนปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบอัตโนมัติ มาดูวิธีการทำกัน</p>
<div class="language-js codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-js codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> redirectUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000/callback'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> baseUrl </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'http://localhost:3000'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// การแสดงผลปุ่มลงชื่อเข้าใช้และลงชื่อออกแบบมีเงื่อนไข</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">render</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> container </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">querySelector</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'#container'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignIn</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">onClickSignOut</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=&gt;</span><span class="token plain"> logtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">baseUrl</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> button </span><span class="token operator">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createElement</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'button'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">innerHTML</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign Out'</span><span class="token plain"> </span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'Sign In'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">addEventListener</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'click'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> isAuthenticated </span><span class="token operator">?</span><span class="token plain"> onClickSignOut </span><span class="token operator">:</span><span class="token plain"> onClickSignIn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  container</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">append</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ OIDC enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->Vanilla JS<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on your IdP<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on your IdP" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on your IdP" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-your-idp">ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-1-create-an-oidc-application-on-your-idp" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน IdP ของคุณ" translate="no">​</a></h3>
<p>เริ่มต้นการผสานรวม OIDC SSO โดยการสร้างแอปพลิเคชันฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP) คุณจะต้องใช้การตั้งค่าต่อไปนี้จากเซิร์ฟเวอร์ Logto</p>
<ul>
<li class=""><strong>Callback URI</strong>: Logto Callback URI หรือที่รู้จักกันในชื่อ Redirect URI หรือ Reply URL คือจุดปลายทาง (endpoint) หรือ URL เฉพาะที่ IdP ใช้สำหรับเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตนสำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จแล้ว IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมายัง URI ที่กำหนดนี้พร้อมกับ authorization code จากนั้น Logto จะดำเนินการยืนยันตัวตนให้สมบูรณ์โดยอิงจาก authorization code ที่ได้รับจาก URI นี้</li>
</ul>
<p>กรอก Logto Callback URI ลงในฟอร์มตั้งค่าแอป OIDC ของ IdP ของคุณ แล้วดำเนินการสร้างแอปพลิเคชันต่อไป (IdP OIDC ส่วนใหญ่มีประเภทแอปพลิเคชันให้เลือกหลากหลายรูปแบบ หากต้องการสร้างตัวเชื่อมต่อ SSO แบบเว็บบน Logto โปรดเลือกประเภท <code>Web Application</code>)</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-oidc-sso-on-logto">ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-2-configure-oidc-sso-on-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: ตั้งค่า OIDC SSO บน Logto" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC บนฝั่งผู้ให้บริการข้อมูลระบุตัวตน (IdP) สำเร็จแล้ว คุณจะต้องนำค่าการตั้งค่าของ IdP กลับมากรอกใน Logto โดยไปที่แท็บ <code>Connection</code> และกรอกค่าต่อไปนี้:</p>
<ul>
<li class=""><strong>Client ID</strong>: ตัวระบุที่ไม่ซ้ำกันซึ่ง IdP กำหนดให้กับแอปพลิเคชัน OIDC ของคุณ ตัวระบุตัวนี้ใช้โดย Logto เพื่อระบุและยืนยันตัวตนของแอปพลิเคชันระหว่างกระบวนการ OIDC</li>
<li class=""><strong>Client Secret</strong>: รหัสลับที่ใช้ร่วมกันระหว่าง Logto กับ IdP รหัสลับนี้ใช้เพื่อยืนยันตัวตนของแอปพลิเคชัน OIDC และรักษาความปลอดภัยของการสื่อสารระหว่าง Logto กับ IdP</li>
<li class=""><strong>ผู้ออก (Issuer)</strong>: URL ของผู้ออก ซึ่งเป็นตัวระบุที่ไม่ซ้ำกันสำหรับ IdP โดยระบุที่ตั้งของผู้ให้บริการข้อมูลระบุตัวตน OIDC ถือเป็นส่วนสำคัญของการตั้งค่า OIDC เพราะช่วยให้ Logto ค้นหา endpoint ที่จำเป็นได้
เพื่อให้ง่ายต่อการตั้งค่า Logto จะดึง endpoint และการตั้งค่าที่จำเป็นของ OIDC มาให้อัตโนมัติ โดยใช้ผู้ออก (issuer) ที่คุณระบุและเรียกไปยัง OIDC discover endpoint ของ IdP ดังนั้นจึงจำเป็นต้องตรวจสอบให้แน่ใจว่า endpoint ของผู้ออกถูกต้องและตั้งค่าอย่างแม่นยำ เพื่อให้ Logto สามารถดึงข้อมูลที่ต้องการได้อย่างถูกต้อง
หลังจากดึงข้อมูลสำเร็จ คุณจะเห็นค่าการตั้งค่าของ IdP ที่ถูกแยกวิเคราะห์แล้วในส่วน issuers</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-configure-scopes-optional">ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-3-configure-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าขอบเขต (Scopes) (ไม่บังคับ)" translate="no">​</a></h2>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชีองค์กรของพวกเขาได้บ้าง</p>
<p>การตั้งค่าขอบเขต (Scopes) ต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<ol>
<li class=""><strong>ผู้ให้บริการข้อมูลระบุตัวตน (IdP) ของคุณ</strong>: กำหนดว่าสิทธิ์ใดได้รับอนุญาตสำหรับการอนุญาต (Authorization) ในคอนโซล IdP ของคุณ<!-- -->
<ul>
<li class="">บาง IdP เปิดใช้งานขอบเขตสาธารณะทั้งหมดโดยค่าเริ่มต้น (ไม่ต้องดำเนินการใด ๆ)</li>
<li class="">บางรายต้องให้คุณอนุญาตสิทธิ์อย่างชัดเจน</li>
</ul>
</li>
<li class=""><strong>ตัวเชื่อมต่อองค์กร Logto</strong>: ระบุขอบเขตที่จะร้องขอระหว่างการยืนยันตัวตน (Authentication) ในการตั้งค่าตัวเชื่อมต่อ OIDC องค์กรของ Logto &gt; ช่อง <code>Scopes</code>
<ul>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> เสมอ เพื่อดึงข้อมูลตัวตนผู้ใช้พื้นฐาน ไม่ว่าคุณจะตั้งค่าขอบเขตเองอย่างไร</li>
<li class="">คุณสามารถเพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) เพื่อขอข้อมูลเพิ่มเติมจาก IdP ได้</li>
</ul>
</li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณต้องเข้าถึง API โดยใช้ขอบเขตเหล่านี้ อย่าลืมเปิดใช้งาน <strong>จัดเก็บโทเค็นเพื่อเข้าถึง API อย่างต่อเนื่อง (Store tokens for persistent API access)</strong> ในตัวเชื่อมต่อองค์กร Logto ของคุณ ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-store-tokens-to-access-third-party-apis-optional">ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-4-store-tokens-to-access-third-party-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: จัดเก็บโทเค็นเพื่อเข้าถึง API ของบุคคลที่สาม (ไม่บังคับ)" translate="no">​</a></h2>
<p>หากคุณต้องการเข้าถึง API ของผู้ให้บริการข้อมูลระบุตัวตน (Identity provider) และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต API (scopes) ที่เฉพาะเจาะจงและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่ต้องการในช่อง <strong>scope</strong> ตามคำแนะนำข้างต้น</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API อย่างต่อเนื่อง (Store tokens for persistent API access)</strong> ในตัวเชื่อมต่อ OIDC สำหรับองค์กรของ Logto โดย Logto จะจัดเก็บโทเค็นการเข้าถึง (access tokens) ไว้อย่างปลอดภัยใน Secret Vault</li>
<li class="">สำหรับผู้ให้บริการข้อมูลระบุตัวตน OIDC <strong>มาตรฐาน</strong> ต้องใส่ขอบเขต <code>offline_access</code> เพื่อให้ได้รับโทเค็นรีเฟรช (refresh token) ซึ่งจะช่วยป้องกันการขอความยินยอมจากผู้ใช้ซ้ำ ๆ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#step-5-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: กำหนดโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h2>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO ให้เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีอีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->OIDC enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ OIDC enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->Vanilla JS<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->OIDC enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-oidc-enterprise-sso-sign-in-with-vanilla-js-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>oidc-enterprise-sso</category>
            <category>vanilla-js</category>
            <category>js</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
        <item>
            <title><![CDATA[วิธีสร้าง Okta enterprise SSO ด้วย iOS (Swift)]]></title>
            <link>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto</link>
            <guid>https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto</guid>
            <pubDate>Wed, 08 Apr 2026 17:38:48 GMT</pubDate>
            <description><![CDATA[{/*]]></description>
            <content:encoded><![CDATA[
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">สำหรับเพื่อนใหม่ของเรา<!-- -->:</span><br><br><p><span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> คือทางเลือกแทน Auth0 ที่ออกแบบมาสำหรับแอปและผลิตภัณฑ์ SaaS ยุคใหม่ โดยมีทั้งบริการ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ <span class="linkWrapper_B4Bt"><a href="https://github.com/logto-io/logto" target="_blank" rel="noopener noreferrer" class="link_hf7f">Open-source<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อช่วยให้คุณเปิดตัวระบบการจัดการเอกลักษณ์และการเข้าถึง (IAM) ได้อย่างรวดเร็ว สนุกกับการยืนยันตัวตน (การยืนยันตัวตน), การอนุญาต (การอนุญาต), และการจัดการหลายผู้เช่า <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">ครบจบในที่เดียว<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p><p>เราแนะนำให้เริ่มต้นด้วย tenant สำหรับการพัฒนาแบบฟรีบน <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Cloud<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อให้คุณสามารถสำรวจฟีเจอร์ทั้งหมดได้อย่างง่ายดาย</p></div></div></div>
<p>ในบทความนี้ เราจะพาคุณไปทีละขั้นตอนเพื่อสร้างประสบการณ์ลงชื่อเข้าใช้ <!-- -->Okta enterprise SSO<!-- --> (การยืนยันตัวตนของผู้ใช้) อย่างรวดเร็วด้วย <a href="https://developer.apple.com/ios" target="_blank" rel="noopener">iOS (Swift)</a> และ <span class="linkWrapper_B4Bt"><a href="https://logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ข้อกำหนดเบื้องต้น</strong></p>
<ul>
<li class="">มี Logto instance ที่พร้อมใช้งาน ดู <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/introduction" target="_blank" rel="noopener noreferrer" class="link_hf7f">หน้าแนะนำ<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> เพื่อเริ่มต้นใช้งาน</li>
<li class="">มีความรู้พื้นฐานเกี่ยวกับ <a href="https://developer.apple.com/ios" target="_blank" rel="noopener">iOS (Swift)</a></li>
<li class="">มีบัญชี <!-- -->Okta enterprise SSO<!-- --> ที่ใช้งานได้</li>
</ul>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="create-an-application-in-logto">สร้างแอปพลิเคชันใน Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#create-an-application-in-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" title="ลิงก์ตรงไปยัง สร้างแอปพลิเคชันใน Logto" translate="no">​</a></h2>
<p>Logto สร้างขึ้นบนพื้นฐานของการยืนยันตัวตน OpenID Connect (OIDC) และการอนุญาต OAuth 2.0 โดยรองรับการจัดการข้อมูลระบุตัวตนแบบรวมศูนย์ข้ามหลายแอปพลิเคชัน ซึ่งมักเรียกว่า การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On; SSO)</p>
<p>ในการสร้างแอปพลิเคชัน <!-- -->Native app<!-- --> ของคุณ เพียงทำตามขั้นตอนเหล่านี้:</p>
<ol>
<li class="">เปิด <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> ในส่วน "เริ่มต้นใช้งาน" ให้คลิกที่ลิงก์ "ดูทั้งหมด" เพื่อเปิดรายการเฟรมเวิร์กของแอปพลิเคชัน หรือคุณสามารถไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/applications" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto Console &gt; Applications<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แล้วคลิกปุ่ม "สร้างแอปพลิเคชัน"<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/get-started.png" alt="Get started">
</li>
<li class="">ในหน้าต่างที่เปิดขึ้น ให้คลิกที่ส่วน "<!-- -->Native app<!-- -->" หรือกรองเฟรมเวิร์ก "<!-- -->Native app<!-- -->" ทั้งหมดที่มีโดยใช้ช่องกรองด่วนทางซ้ายมือ จากนั้นคลิกที่การ์ดเฟรมเวิร์ก "<!-- -->iOS (Swift)<!-- -->" เพื่อเริ่มสร้างแอปพลิเคชันของคุณ<!-- -->
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/framework-list.png" alt="Frameworks">
</li>
<li class="">กรอกชื่อแอปพลิเคชัน เช่น "Bookstore" แล้วคลิก "สร้างแอปพลิเคชัน"</li>
</ol>
<p>🎉 เยี่ยมมาก! คุณเพิ่งสร้างแอปพลิเคชันแรกของคุณใน Logto คุณจะเห็นหน้าข้อความแสดงความยินดีซึ่งมีคู่มือการเชื่อมต่ออย่างละเอียด ให้ทำตามคู่มือเพื่อดูประสบการณ์ที่จะเกิดขึ้นในแอปพลิเคชันของคุณ</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="integrate-with-logto">ผสานรวม iOS (Swift) กับ Logto<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#integrate-with-logto" class="hash-link" aria-label="ลิงก์ตรงไปยัง ผสานรวม iOS (Swift) กับ Logto" title="ลิงก์ตรงไปยัง ผสานรวม iOS (Swift) กับ Logto" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="add-logto-sdk-as-a-dependency">เพิ่ม Logto SDK เป็น dependency<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#add-logto-sdk-as-a-dependency" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่ม Logto SDK เป็น dependency" title="ลิงก์ตรงไปยัง เพิ่ม Logto SDK เป็น dependency" translate="no">​</a></h3>
<p>ใช้ URL ต่อไปนี้เพื่อเพิ่ม Logto SDK เป็น dependency ใน Swift Package Manager</p>
<div class="language-bash codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-bash codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token plain">https://github.com/logto-io/swift.git</span><br></span></code></pre></div></div>
<p>ตั้งแต่ Xcode 11 เป็นต้นมา คุณสามารถ <span class="linkWrapper_B4Bt"><a href="https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app" target="_blank" rel="noopener noreferrer" class="link_hf7f">นำเข้า Swift package ได้โดยตรง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> โดยไม่ต้องใช้เครื่องมือเพิ่มเติมใด ๆ</p>
<p>ขณะนี้ เรายังไม่รองรับ <strong>Carthage</strong> และ <strong>CocoaPods</strong> เนื่องจากปัญหาทางเทคนิคบางประการ</p>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="carthage">Carthage<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#carthage" class="hash-link" aria-label="ลิงก์ตรงไปยัง Carthage" title="ลิงก์ตรงไปยัง Carthage" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><p>Carthage <span class="linkWrapper_B4Bt"><a href="https://github.com/Carthage/Carthage/issues/1226#issuecomment-290931385" target="_blank" rel="noopener noreferrer" class="link_hf7f">ต้องการไฟล์ <code>xcodeproj</code> เพื่อ build<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> แต่ <code>swift package generate-xcodeproj</code> จะรายงานข้อผิดพลาด เนื่องจากเราใช้ binary targets สำหรับปลั๊กอินโซเชียลแบบ native เราจะพยายามหาวิธีแก้ไขในภายหลัง</p></div></div></details>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="cocoapods">CocoaPods<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#cocoapods" class="hash-link" aria-label="ลิงก์ตรงไปยัง CocoaPods" title="ลิงก์ตรงไปยัง CocoaPods" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><p>CocoaPods <span class="linkWrapper_B4Bt"><a href="https://github.com/CocoaPods/CocoaPods/issues/3276" target="_blank" rel="noopener noreferrer" class="link_hf7f">ไม่รองรับ local dependency<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ monorepo ดังนั้นจึงยากที่จะสร้าง <code>.podspec</code> สำหรับ repo นี้</p></div></div></details>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="init-logtoclient">เริ่มต้น LogtoClient<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#init-logtoclient" class="hash-link" aria-label="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" title="ลิงก์ตรงไปยัง เริ่มต้น LogtoClient" translate="no">​</a></h3>
<p>เริ่มต้นไคลเอนต์โดยการสร้างอินสแตนซ์ <code>LogtoClient</code> ด้วยอ็อบเจกต์ <code>LogtoConfig</code></p>
<div class="language-swift codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">ContentView.swift</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-swift codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token class-name">Logto</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> config </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token operator">?</span><span class="token plain"> </span><span class="token class-name">LogtoConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  endpoint</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"&lt;your-logto-endpoint&gt;"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// เช่น http://localhost:3001</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  appId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"&lt;your-app-id&gt;"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> client </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">LogtoClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">useConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre></div></div>
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">ข้อมูล<!-- -->:</span><p>โดยปกติ เราจะจัดเก็บข้อมูลรับรอง เช่น โทเค็น ID (ID Token) และ โทเค็นรีเฟรช (Refresh Token) ไว้ใน Keychain ดังนั้นผู้ใช้จึงไม่จำเป็นต้องลงชื่อเข้าใช้อีกเมื่อกลับมา</p><p>หากต้องการปิดการทำงานนี้ ให้ตั้งค่า <code>usingPersistStorage</code> เป็น <code>false</code>:</p><div class="language-swift codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-swift codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> config </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token operator">?</span><span class="token plain"> </span><span class="token class-name">LogtoConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token comment" style="color:rgb(98, 114, 164)">// ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  usingPersistStorage</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre></div></div></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="sign-in">ลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง ลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง ลงชื่อเข้าใช้" translate="no">​</a></h3>
<p>ก่อนที่เราจะลงลึกในรายละเอียด นี่คือภาพรวมประสบการณ์ของผู้ใช้ปลายทาง กระบวนการลงชื่อเข้าใช้สามารถสรุปได้ดังนี้:</p>
<!-- -->
<ol>
<li class="">แอปของคุณเรียกใช้งานเมธอดลงชื่อเข้าใช้</li>
<li class="">ผู้ใช้จะถูกเปลี่ยนเส้นทางไปยังหน้าลงชื่อเข้าใช้ของ Logto สำหรับแอปเนทีฟ ระบบจะเปิดเบราว์เซอร์ของระบบ</li>
<li class="">ผู้ใช้ลงชื่อเข้าใช้และถูกเปลี่ยนเส้นทางกลับไปยังแอปของคุณ (ตามที่กำหนดไว้ใน redirect URI)</li>
</ol>
<details class="details_ydV2 details_Jw1Q" data-collapsed="true"><summary><h3 class="anchor anchorTargetStickyNavbar_kxPF" id="regarding-redirect-based-sign-in">เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#regarding-redirect-based-sign-in" class="hash-link" aria-label="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" title="ลิงก์ตรงไปยัง เกี่ยวกับการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง (redirect-based sign-in)" translate="no">​</a></h3></summary><div><div class="collapsibleContent_JbGB"><ol>
<li class="">กระบวนการยืนยันตัวตนนี้เป็นไปตามโปรโตคอล <span class="linkWrapper_B4Bt"><a href="https://openid.net/specs/openid-connect-core-1_0.html" target="_blank" rel="noopener noreferrer" class="link_hf7f">OpenID Connect (OIDC)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และ Logto บังคับใช้มาตรการรักษาความปลอดภัยอย่างเข้มงวดเพื่อปกป้องการลงชื่อเข้าใช้ของผู้ใช้</li>
<li class="">หากคุณมีหลายแอป คุณสามารถใช้ผู้ให้บริการข้อมูลระบุตัวตน (Logto) เดียวกันได้ เมื่อผู้ใช้ลงชื่อเข้าใช้แอปหนึ่งแล้ว Logto จะดำเนินการลงชื่อเข้าใช้โดยอัตโนมัติเมื่อผู้ใช้เข้าถึงแอปอื่น</li>
</ol><p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับเหตุผลและประโยชน์ของการลงชื่อเข้าใช้แบบเปลี่ยนเส้นทาง โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/concepts/sign-in-experience" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>อธิบายประสบการณ์การลงชื่อเข้าใช้ของ Logto<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p></div></div></details>
<hr>
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="configure-redirect-uri">กำหนดค่า Redirect URI<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#configure-redirect-uri" class="hash-link" aria-label="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" title="ลิงก์ตรงไปยัง กำหนดค่า Redirect URI" translate="no">​</a></h4>
<p>ไปที่หน้ารายละเอียดแอปพลิเคชันของ Logto Console เพิ่ม Redirect URI <code>io.logto://callback</code> แล้วคลิก "บันทึกการเปลี่ยนแปลง" (Save changes)</p>
<img alt="Redirect URI ใน Logto Console" src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/ios-redirect-uri.png" width="600px">
<div class="theme-admonition theme-admonition-info admonition_Gfwi alert alert--info"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">ข้อมูล<!-- -->:</span><p>Redirect URI ใน iOS SDK ใช้สำหรับการทำงานภายในเท่านั้น <em>ไม่จำเป็นต้อง</em> เพิ่ม <span class="linkWrapper_B4Bt"><a href="https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app" target="_blank" rel="noopener noreferrer" class="link_hf7f">Custom URL Scheme<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> จนกว่าจะมีตัวเชื่อมต่อร้องขอ</p></div></div></div>
<h4 class="anchor anchorTargetStickyNavbar_kxPF" id="sign-in-and-sign-out">การลงชื่อเข้าใช้และออกจากระบบ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#sign-in-and-sign-out" class="hash-link" aria-label="ลิงก์ตรงไปยัง การลงชื่อเข้าใช้และออกจากระบบ" title="ลิงก์ตรงไปยัง การลงชื่อเข้าใช้และออกจากระบบ" translate="no">​</a></h4>
<div class="theme-admonition theme-admonition-note admonition_Gfwi alert alert--secondary"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">บันทึก<!-- -->:</span><p>ก่อนเรียก <code>.signInWithBrowser(redirectUri:)</code> โปรดตรวจสอบให้แน่ใจว่าคุณได้กำหนดค่า Redirect URI ใน Admin Console อย่างถูกต้องแล้ว</p></div></div></div>
<p>คุณสามารถใช้ <code>client.signInWithBrowser(redirectUri:)</code> เพื่อให้ผู้ใช้ลงชื่อเข้าใช้ และ <code>client.signOut()</code> เพื่อออกจากระบบ</p>
<p>ตัวอย่างเช่น ในแอป SwiftUI:</p>
<div class="language-swift codeBlockContainer_DlGl theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockTitle_aDbb">ContentView.swift</div><div class="codeBlockContent_FuAU"><pre tabindex="0" class="prism-code language-swift codeBlock_pF9h thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_WtJL"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">struct</span><span class="token plain"> </span><span class="token class-name">ContentView</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token class-name">View</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token attribute atrule">@State</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> isAuthenticated</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token class-name">Bool</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">init</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    isAuthenticated </span><span class="token operator">=</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">isAuthenticated</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">some</span><span class="token plain"> </span><span class="token class-name">View</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token class-name">VStack</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> isAuthenticated </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token class-name">Button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"Sign Out"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token class-name">Task</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">self</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">signOut</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">else</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token class-name">Button</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string-literal string" style="color:rgb(255, 121, 198)">"Sign In"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token class-name">Task</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">self</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">do</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">signInWithBrowser</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">redirectUri</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> "$</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">                props</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">redirectUris</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token number">0</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"> </span><span class="token operator">??</span><span class="token plain"> 'io</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">logto</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token operator">//</span><span class="token plain">callback'</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              isAuthenticated </span><span class="token operator">=</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">let</span><span class="token plain"> error </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token class-name">LogtoClientErrors</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">SignIn</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token comment" style="color:rgb(98, 114, 164)">// เกิดข้อผิดพลาดระหว่างการลงชื่อเข้าใช้</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">              </span><span class="token comment" style="color:rgb(98, 114, 164)">// ข้อผิดพลาดอื่น ๆ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">        </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="checkpoint-test-your-application">จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#checkpoint-test-your-application" class="hash-link" aria-label="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" title="ลิงก์ตรงไปยัง จุดตรวจสอบ: ทดสอบแอปพลิเคชันของคุณ" translate="no">​</a></h3>
<p>ตอนนี้คุณสามารถทดสอบแอปพลิเคชันของคุณได้แล้ว:</p>
<ol>
<li class="">รันแอปพลิเคชันของคุณ คุณจะเห็นปุ่มลงชื่อเข้าใช้</li>
<li class="">คลิกปุ่มลงชื่อเข้าใช้ SDK จะเริ่มกระบวนการลงชื่อเข้าใช้และเปลี่ยนเส้นทางคุณไปยังหน้าลงชื่อเข้าใช้ของ Logto</li>
<li class="">หลังจากที่คุณลงชื่อเข้าใช้แล้ว คุณจะถูกเปลี่ยนเส้นทางกลับไปยังแอปพลิเคชันของคุณและเห็นปุ่มลงชื่อออก</li>
<li class="">คลิกปุ่มลงชื่อออกเพื่อเคลียร์ที่เก็บโทเค็นและออกจากระบบ</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="add-connector-connector">เพิ่มตัวเชื่อมต่อ Okta enterprise SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#add-connector-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" title="ลิงก์ตรงไปยัง เพิ่มตัวเชื่อมต่อ Okta enterprise SSO" translate="no">​</a></h2>
<p>เพื่อให้ง่ายต่อการจัดการการเข้าถึงและได้รับการปกป้องในระดับองค์กรสำหรับลูกค้ารายใหญ่ของคุณ เชื่อมต่อกับ <!-- -->iOS (Swift)<!-- --> ในฐานะผู้ให้บริการข้อมูลระบุตัวตนแบบเฟเดอเรต (federated identity provider) ตัวเชื่อมต่อ Logto Enterprise SSO ช่วยให้คุณสร้างการเชื่อมต่อนี้ได้ภายในไม่กี่นาทีโดยการกรอกพารามิเตอร์เพียงไม่กี่รายการ</p>
<p>ในการเพิ่มตัวเชื่อมต่อ Enterprise SSO ให้ทำตามขั้นตอนดังนี้:</p>
<ol>
<li class="">ไปที่ <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">Logto console &gt; Enterprise SSO<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-page.png" alt="หน้าการตั้งค่า SSO">
<ol start="2">
<li class="">คลิกปุ่ม "Add enterprise connector" และเลือกประเภทผู้ให้บริการ SSO ของคุณ เลือกจากตัวเชื่อมต่อสำเร็จรูปสำหรับ Microsoft Entra ID (Azure AD), Google Workspace, และ Okta หรือสร้างการเชื่อมต่อ SSO แบบกำหนดเองโดยใช้มาตรฐาน OpenID Connect (OIDC) หรือ SAML</li>
<li class="">กำหนดชื่อที่ไม่ซ้ำกัน (เช่น SSO sign-in for Acme Company)</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/select-your-sso-provider.png" alt="เลือกผู้ให้บริการ SSO ของคุณ">
<ol start="4">
<li class="">ตั้งค่าการเชื่อมต่อกับ IdP ของคุณในแท็บ "Connection" ดูคู่มือด้านบนสำหรับแต่ละประเภทตัวเชื่อมต่อ</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-connection-settings.png" alt="การตั้งค่า SSO connection">
<ol start="5">
<li class="">ปรับแต่งประสบการณ์ SSO และ <strong>โดเมนอีเมล</strong> ขององค์กรในแท็บ "Experience" ผู้ใช้ที่ลงชื่อเข้าใช้ด้วยโดเมนอีเมลที่เปิดใช้ SSO จะถูกเปลี่ยนเส้นทางไปยังการยืนยันตัวตน SSO</li>
</ol>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-experience-settings.png" alt="ประสบการณ์ SSO">
<ol start="6">
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="set-up-connectorconfigname">ตั้งค่า OIDC application on Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#set-up-connectorconfigname" class="hash-link" aria-label="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" title="ลิงก์ตรงไปยัง ตั้งค่า OIDC application on Okta admin portal" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-1-create-an-oidc-application-on-okta-admin-portal">ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#step-1-create-an-oidc-application-on-okta-admin-portal" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 1: สร้างแอป OIDC บน Okta admin portal" translate="no">​</a></h3>
<ul>
<li class="">ไปที่พอร์ทัลผู้ดูแลระบบ Okta และลงชื่อเข้าใช้ในฐานะผู้ดูแลระบบ</li>
<li class="">ไปที่หน้า <code>Applications</code> / <code>Applications</code> โดยใช้เมนูด้านข้าง</li>
<li class="">คลิกปุ่ม <code>Create App Integration</code> เพื่อสร้างแอป OIDC ใหม่</li>
<li class="">เลือกตัวเลือก <code>OIDC - OpenID Connect</code> เป็น <code>Sign-in method</code></li>
<li class="">เลือกตัวเลือก <code>Web Application</code> เป็น <code>Application type</code></li>
</ul>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_create_application.webp" alt="สร้างแอปพลิเคชัน Okta">
<p>คลิกปุ่ม <code>Next</code> เพื่อดำเนินการต่อ</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-2-configure-the-application-settings">ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#step-2-configure-the-application-settings" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 2: กำหนดค่าการตั้งค่าแอปพลิเคชัน" translate="no">​</a></h3>
<ol>
<li class="">กำหนด <code>App integration name</code> ซึ่งจะใช้เป็นตัวระบุของแอปพลิเคชัน OIDC ของคุณ</li>
<li class="">เพิ่ม <code>Sign-in redirect URIs</code> ใหม่โดยใช้ callback URL ของตัวเชื่อมต่อ Logto SSO</li>
</ol>
<p>นี่คือ URI ที่ Okta จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้หลังจากการยืนยันตัวตน (Authentication) สำเร็จ เมื่อผู้ใช้ยืนยันตัวตนกับ IdP สำเร็จ IdP จะเปลี่ยนเส้นทางเบราว์เซอร์ของผู้ใช้กลับมาที่ URI ที่กำหนดนี้พร้อมกับรหัสการอนุญาต (authorization code) Logto จะดำเนินการยืนยันตัวตน (Authentication) ให้สมบูรณ์โดยอิงจากรหัสการอนุญาตที่ได้รับจาก URI นี้</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_application_settings.webp" alt="การตั้งค่าแอปพลิเคชัน Okta">
<ol start="3">
<li class="">กำหนดผู้ใช้ให้กับแอปพลิเคชัน</li>
</ol>
<p>ตามการตั้งค่า <code>Assignments</code> คุณสามารถเลือกกำหนดแอปพลิเคชันให้กับผู้ใช้ทั้งหมด หรือเฉพาะผู้ใช้ / กลุ่มที่ต้องการ</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_assign_users.webp" alt="Okta assign users">
<p>คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าแอปพลิเคชัน</p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-3-set-up-logto-connector-with-the-client-credentials">ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#step-3-set-up-logto-connector-with-the-client-credentials" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 3: ตั้งค่าตัวเชื่อมต่อ Logto ด้วย client credentials" translate="no">​</a></h3>
<p>หลังจากสร้างแอปพลิเคชัน OIDC สำเร็จแล้ว คุณจะถูกเปลี่ยนเส้นทางไปยังหน้ารายละเอียดของแอปพลิเคชัน</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/assets/okta_client_credentials.webp" alt="Okta client credentials">
<p>คัดลอก <code>client ID</code> และ <code>client secret</code> แล้วกรอกลงในช่องที่เกี่ยวข้องบนแท็บ <code>Connection</code> ของตัวเชื่อมต่อ SSO ของ Logto</p>
<p>ใช้โดเมน Okta ของคุณเป็น <code>issuer</code> ตัวอย่าง: <code>https://dev-12345678.okta.com</code> เมื่อกรอกข้อมูลครบทุกช่องแล้ว ให้คลิกปุ่ม <code>Save</code> เพื่อบันทึกการตั้งค่าตัวเชื่อมต่อ</p>
<p>หากลิงก์ <code>issuer</code> ที่คุณให้มาถูกต้อง คุณจะเห็นรายการการตั้งค่า Okta IdP ที่ถูกแยกแสดงแบบเต็มด้านล่างช่อง <code>issuer</code></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-4-additional-scopes-optional">ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#step-4-additional-scopes-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 4: ขอบเขตเพิ่มเติม (ไม่บังคับ)" translate="no">​</a></h3>
<p>ขอบเขต (Scopes) กำหนดสิทธิ์ (Permissions) ที่แอปของคุณร้องขอจากผู้ใช้ และควบคุมว่าแอปของคุณสามารถเข้าถึงข้อมูลใดจากบัญชี Okta ของพวกเขาได้ การร้องขอสิทธิ์ Okta เพิ่มเติมจำเป็นต้องมีการกำหนดค่าทั้งสองฝั่ง:</p>
<p><strong>ใน Okta admin console:</strong></p>
<ol>
<li class="">ไปที่ <strong>Applications &gt; Applications</strong> และเลือกแอป OIDC ของคุณ</li>
<li class="">ไปที่แท็บ <strong>Assignments</strong> เพื่อให้แน่ใจว่าแอปของคุณสามารถเข้าถึงผู้ใช้และกลุ่มที่ต้องการได้</li>
<li class="">สำหรับขอบเขตแบบกำหนดเอง ให้ไปที่ <strong>Security &gt; API &gt; Authorization Servers</strong> และเลือก authorization server ของคุณ</li>
<li class="">เพิ่มขอบเขตแบบกำหนดเองหากจำเป็น:<!-- -->
<ul>
<li class="">คลิก <strong>Scopes</strong> แล้วเลือก <strong>Add Scope</strong></li>
<li class="">กำหนดชื่อขอบเขต เช่น <code>okta.users.read</code> หรือ <code>okta.groups.read</code> สำหรับการเข้าถึง Okta APIs</li>
<li class="">กำหนดข้อกำหนดการขอความยินยอม (consent) สำหรับแต่ละขอบเขต</li>
</ul>
</li>
</ol>
<p>สำหรับรายการขอบเขตที่มีทั้งหมดและคำอธิบาย โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/api/openapi/okta-oauth/guides/overview/#scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">เอกสาร Okta OIDC<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<p><strong>ใน Logto Okta connector:</strong></p>
<ol>
<li class="">Logto จะเพิ่มขอบเขต <code>openid</code>, <code>profile</code> และ <code>email</code> โดยอัตโนมัติเพื่อดึงข้อมูลตัวตนพื้นฐานของผู้ใช้ คุณสามารถเว้นว่างช่อง <code>Scopes</code> ได้หากต้องการเพียงข้อมูลผู้ใช้พื้นฐาน</li>
<li class="">เพิ่ม <code>offline_access</code> ในช่อง <code>Scopes</code> หากคุณต้องการจัดเก็บโทเค็นเพื่อเข้าถึง API แบบถาวร ขอบเขตนี้จะเปิดใช้งานโทเค็นรีเฟรช (Refresh token) สำหรับการเข้าถึง API ระยะยาว</li>
<li class="">เพิ่มขอบเขตเพิ่มเติม (คั่นด้วยช่องว่าง) ในช่อง <code>Scopes</code> เพื่อร้องขอข้อมูลเพิ่มเติมจาก Okta เช่น <code>okta.users.read okta.groups.read</code></li>
</ol>
<div class="theme-admonition theme-admonition-tip admonition_Gfwi alert alert--success"><div class="admonitionContent_UjKb"><div class="content_hlIx"><span class="title_towL" data-type="title">เคล็ดลับ<!-- -->:</span><p>หากแอปของคุณร้องขอขอบเขตเหล่านี้เพื่อเข้าถึง Okta APIs และดำเนินการต่าง ๆ โปรดตรวจสอบให้แน่ใจว่าได้เปิดใช้งาน <strong>Store tokens for persistent API access</strong> ใน Logto Okta connector ดูรายละเอียดในหัวข้อถัดไป</p></div></div></div>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-5-store-tokens-to-access-okta-apis-optional">ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#step-5-store-tokens-to-access-okta-apis-optional" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 5: จัดเก็บโทเค็นเพื่อเข้าถึง Okta API (ไม่บังคับ)" translate="no">​</a></h3>
<p>หากคุณต้องการเข้าถึง <span class="linkWrapper_B4Bt"><a href="https://developer.okta.com/docs/guides/request-user-consent/main/#enable-consent-for-scopes" target="_blank" rel="noopener noreferrer" class="link_hf7f">Okta scopes<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span> และดำเนินการต่าง ๆ ด้วยการอนุญาตของผู้ใช้ Logto จำเป็นต้องขอขอบเขต (scopes) เฉพาะและจัดเก็บโทเค็น</p>
<ol>
<li class="">เพิ่มขอบเขตที่จำเป็นในหน้าตั้งค่าสิทธิ์ API ของ Okta developer console และในตัวเชื่อมต่อ Okta ของ Logto</li>
<li class="">เปิดใช้งาน <strong>จัดเก็บโทเค็นสำหรับการเข้าถึง API แบบถาวร</strong> ในตัวเชื่อมต่อ Okta ของ Logto โดย Logto จะจัดเก็บ Okta access และ refresh tokens อย่างปลอดภัยใน Secret Vault</li>
<li class="">เพื่อให้แน่ใจว่า refresh tokens จะถูกส่งกลับ ให้เพิ่มขอบเขต <code>offline_access</code> ในสิทธิ์ของแอป Okta ของคุณ และรวมไว้ในขอบเขตของตัวเชื่อมต่อ Okta ของ Logto ด้วย ขอบเขตนี้จะช่วยให้แอปของคุณสามารถเข้าถึงทรัพยากรได้เป็นระยะเวลานาน</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="step-6-set-email-domains-and-enable-the-sso-connector">ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#step-6-set-email-domains-and-enable-the-sso-connector" class="hash-link" aria-label="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" title="ลิงก์ตรงไปยัง ขั้นตอนที่ 6: ตั้งค่าโดเมนอีเมลและเปิดใช้งานตัวเชื่อมต่อ SSO" translate="no">​</a></h3>
<p>ระบุ <code>email domains</code> ขององค์กรของคุณในแท็บ <code>SSO experience</code> ของตัวเชื่อมต่อ Logto การดำเนินการนี้จะเปิดใช้งานตัวเชื่อมต่อ SSO เป็นวิธีการยืนยันตัวตนสำหรับผู้ใช้เหล่านั้น</p>
<p>ผู้ใช้ที่มีที่อยู่อีเมลในโดเมนที่ระบุจะถูกเปลี่ยนเส้นทางให้ใช้ตัวเชื่อมต่อ SSO ของคุณเป็นวิธีการยืนยันตัวตนเพียงวิธีเดียว</p>
<p>สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการสร้างการเชื่อมต่อ OIDC กับ Okta โปรดดูที่ <span class="linkWrapper_B4Bt"><a href="https://help.okta.com/oie/en-us/content/topics/apps/apps_app_integration_wizard_oidc.htm" target="_blank" rel="noopener noreferrer" class="link_hf7f">Create OIDC App Integrations<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h3 class="anchor anchorTargetStickyNavbar_kxPF" id="save-your-configuration">บันทึกการตั้งค่าของคุณ<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#save-your-configuration" class="hash-link" aria-label="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" title="ลิงก์ตรงไปยัง บันทึกการตั้งค่าของคุณ" translate="no">​</a></h3>
<p>โปรดตรวจสอบให้แน่ใจว่าคุณได้กรอกค่าที่จำเป็นในพื้นที่การตั้งค่าตัวเชื่อมต่อ Logto เรียบร้อยแล้ว คลิก "บันทึกและเสร็จสิ้น" (หรือ "บันทึกการเปลี่ยนแปลง") และตัวเชื่อมต่อ <!-- -->Okta enterprise SSO<!-- --> ควรพร้อมใช้งานแล้ว</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="enable-connector-connector-in-sign-in-experience">เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#enable-connector-connector-in-sign-in-experience" class="hash-link" aria-label="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" title="ลิงก์ตรงไปยัง เปิดใช้งานตัวเชื่อมต่อ Okta enterprise SSO ในประสบการณ์การลงชื่อเข้าใช้" translate="no">​</a></h2>
<p>คุณไม่จำเป็นต้องตั้งค่าตัวเชื่อมต่อองค์กร (enterprise connectors) ทีละตัว Logto ช่วยให้การผสานรวม SSO เข้ากับแอปพลิเคชันของคุณง่ายขึ้นเพียงคลิกเดียว</p>
<ol>
<li class="">ไปที่: <span class="linkWrapper_B4Bt"><a href="https://cloud.logto.io/to/sign-in-experience/sign-up-and-sign-in" target="_blank" rel="noopener noreferrer" class="link_hf7f">Console &gt; ประสบการณ์การลงชื่อเข้าใช้ &gt; การสมัครและลงชื่อเข้าใช้<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></li>
<li class="">เปิดใช้งานสวิตช์ "SSO สำหรับองค์กร (Enterprise SSO)"</li>
<li class="">บันทึกการเปลี่ยนแปลง</li>
</ol>
<p>เมื่อเปิดใช้งานแล้ว จะมีปุ่ม "การลงชื่อเข้าใช้ครั้งเดียว (Single Sign-On)" ปรากฏในหน้าลงชื่อเข้าใช้ของคุณ ผู้ใช้ระดับองค์กรที่มีโดเมนอีเมลที่เปิดใช้งาน SSO สามารถเข้าถึงบริการของคุณผ่านผู้ให้บริการข้อมูลระบุตัวตน (IdPs) ขององค์กรตนเอง</p>
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-email-auto-navigation.png" alt="ตรวจจับการลงชื่อเข้าใช้ SSO อัตโนมัติผ่านโดเมนอีเมล">
<img src="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/img/tutorial/sso-link-button-navigation.png" alt="ไปยังหน้าลงชื่อเข้าใช้ SSO ด้วยการคลิกปุ่มลิงก์ด้วยตนเอง">
<p>หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับประสบการณ์ผู้ใช้ SSO รวมถึง SSO ที่เริ่มต้นโดย SP และ SSO ที่เริ่มต้นโดย IdP โปรดดูที่ User flows: <span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows/enterprise-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" viewBox="0 0 20 20"><path fill="currentColor" d="m8.49 14.129-1.302 1.265a1.82 1.82 0 0 1-2.574-2.575l3.34-3.347a1.81 1.81 0 0 1 2.493-.066l.089.073a.736.736 0 1 0 1.03-1.052 2 2 0 0 0-.133-.154 3.28 3.28 0 0 0-4.48.162l-3.384 3.347a3.296 3.296 0 0 0 4.657 4.657l1.272-1.244A.736.736 0 0 0 8.49 14.13m7.865-10.476a3.303 3.303 0 0 0-4.657 0l-1.273 1.243a.736.736 0 0 0 1.008 1.067l1.273-1.265a1.82 1.82 0 1 1 2.575 2.574l-3.34 3.348a1.81 1.81 0 0 1-2.494.066l-.088-.074a.736.736 0 1 0-1.03 1.052q.08.083.169.155a3.29 3.29 0 0 0 4.48-.162l3.347-3.347a3.303 3.303 0 0 0 .03-4.657"></path></svg>SSO สำหรับองค์กร (Enterprise SSO)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span></p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="testing-and-validation">การทดสอบและการตรวจสอบความถูกต้อง<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#testing-and-validation" class="hash-link" aria-label="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" title="ลิงก์ตรงไปยัง การทดสอบและการตรวจสอบความถูกต้อง" translate="no">​</a></h2>
<p>กลับไปที่แอป <!-- -->iOS (Swift)<!-- --> ของคุณ ตอนนี้คุณควรจะสามารถลงชื่อเข้าใช้ด้วย <!-- -->Okta enterprise SSO<!-- --> ได้แล้ว ขอให้สนุก!</p>
<h2 class="anchor anchorTargetStickyNavbar_kxPF" id="further-readings">อ่านเพิ่มเติม<a href="https://renovate-minimatch--9-0-0-9.logto-docs-tutorials.pages.dev/th/how-to/build-okta-enterprise-sso-sign-in-with-ios-swift-and-logto#further-readings" class="hash-link" aria-label="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" title="ลิงก์ตรงไปยัง อ่านเพิ่มเติม" translate="no">​</a></h2>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/end-user-flows" target="_blank" rel="noopener noreferrer" class="link_hf7f">กระบวนการสำหรับผู้ใช้ปลายทาง<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: Logto มีโฟลว์การยืนยันตัวตนสำเร็จรูปพร้อมใช้งาน รวมถึง MFA และ Enterprise SSO พร้อม API อันทรงพลังสำหรับการปรับแต่งการตั้งค่าบัญชี การตรวจสอบความปลอดภัย และประสบการณ์แบบหลายผู้เช่า (multi-tenant) ได้อย่างยืดหยุ่น</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/authorization" target="_blank" rel="noopener noreferrer" class="link_hf7f">การอนุญาต (Authorization)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: การอนุญาต (Authorization) กำหนดว่าผู้ใช้สามารถทำอะไรหรือเข้าถึงทรัพยากรใดได้บ้างหลังจากได้รับการยืนยันตัวตนแล้ว สำรวจวิธีปกป้อง API ของคุณสำหรับแอปเนทีฟและแอปหน้าเดียว (SPA) และการใช้งานการควบคุมการเข้าถึงตามบทบาท (RBAC)</p>
<p><span class="linkWrapper_B4Bt"><a href="https://docs.logto.io/organizations" target="_blank" rel="noopener noreferrer" class="link_hf7f">องค์กร (Organizations)<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: ฟีเจอร์องค์กรมีประสิทธิภาพอย่างยิ่งใน SaaS แบบหลายผู้เช่าและแอป B2B โดยช่วยให้สร้างผู้เช่า จัดการสมาชิก RBAC ระดับองค์กร และ Just-in-Time Provisioning ได้</p>
<p><span class="linkWrapper_B4Bt"><a href="https://blog.logto.io/ciam-101-intro-authn-sso" target="_blank" rel="noopener noreferrer" class="link_hf7f">ชุดบทความ Customer IAM<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" class="iconExternalLink_2l9O externalLink_ia3C"><path d="M12.422 7.54748C12.2452 7.54748 12.0757 7.61772 11.9506 7.74274C11.8256 7.86777 11.7554 8.03734 11.7554 8.21415V13.0008C11.7554 13.1776 11.6851 13.3472 11.5601 13.4722C11.4351 13.5972 11.2655 13.6675 11.0887 13.6675H3.75537C3.57856 13.6675 3.40899 13.5972 3.28397 13.4722C3.15894 13.3472 3.0887 13.1776 3.0887 13.0008V5.66748C3.0887 5.49067 3.15894 5.3211 3.28397 5.19608C3.40899 5.07105 3.57856 5.00081 3.75537 5.00081H8.54204C8.71885 5.00081 8.88842 4.93058 9.01344 4.80555C9.13847 4.68053 9.2087 4.51096 9.2087 4.33415C9.2087 4.15734 9.13847 3.98777 9.01344 3.86274C8.88842 3.73772 8.71885 3.66748 8.54204 3.66748H3.75537C3.22494 3.66748 2.71623 3.87819 2.34116 4.25327C1.96608 4.62834 1.75537 5.13705 1.75537 5.66748V13.0008C1.75537 13.5312 1.96608 14.04 2.34116 14.415C2.71623 14.7901 3.22494 15.0008 3.75537 15.0008H11.0887C11.6191 15.0008 12.1278 14.7901 12.5029 14.415C12.878 14.04 13.0887 13.5312 13.0887 13.0008V8.21415C13.0887 8.03734 13.0185 7.86777 12.8934 7.74274C12.7684 7.61772 12.5988 7.54748 12.422 7.54748ZM15.0354 2.08081C14.9677 1.91791 14.8383 1.78846 14.6754 1.72081C14.5952 1.68665 14.5092 1.66853 14.422 1.66748H10.422C10.2452 1.66748 10.0757 1.73772 9.95063 1.86274C9.82561 1.98777 9.75537 2.15734 9.75537 2.33415C9.75537 2.51096 9.82561 2.68053 9.95063 2.80555C10.0757 2.93058 10.2452 3.00081 10.422 3.00081H12.8154L5.9487 9.86081C5.88622 9.92279 5.83662 9.99652 5.80278 10.0778C5.76893 10.159 5.75151 10.2461 5.75151 10.3341C5.75151 10.4222 5.76893 10.5093 5.80278 10.5905C5.83662 10.6718 5.88622 10.7455 5.9487 10.8075C6.01068 10.87 6.08441 10.9196 6.16565 10.9534C6.24689 10.9873 6.33403 11.0047 6.42204 11.0047C6.51005 11.0047 6.59718 10.9873 6.67842 10.9534C6.75966 10.9196 6.8334 10.87 6.89537 10.8075L13.7554 3.94081V6.33415C13.7554 6.51096 13.8256 6.68053 13.9506 6.80555C14.0757 6.93058 14.2452 7.00081 14.422 7.00081C14.5988 7.00081 14.7684 6.93058 14.8934 6.80555C15.0185 6.68053 15.0887 6.51096 15.0887 6.33415V2.33415C15.0877 2.24703 15.0695 2.16096 15.0354 2.08081Z" fill="currentColor"></path></svg></a></span>: บทความต่อเนื่องเกี่ยวกับการจัดการข้อมูลระบุตัวตนและการเข้าถึงของลูกค้า (Customer IAM) ตั้งแต่ระดับพื้นฐาน 101 ไปจนถึงหัวข้อขั้นสูงและอื่น ๆ</p>]]></content:encoded>
            <category>ผู้ให้บริการ SSO</category>
            <category>okta-enterprise-sso</category>
            <category>ios-swift</category>
            <category>swift</category>
            <category>การยืนยันตัวตน SAML</category>
            <category>การเข้าสู่ระบบองค์กร</category>
            <category>การเข้าสู่ระบบ SSO</category>
        </item>
    </channel>
</rss>