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

<channel>
	<title>OAUTH Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/oauth/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/oauth/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 21 Feb 2026 07:13:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Mastering Authentication with Better Auth</title>
		<link>https://www.scmgalaxy.com/tutorials/mastering-authentication-with-better-auth/</link>
					<comments>https://www.scmgalaxy.com/tutorials/mastering-authentication-with-better-auth/#respond</comments>
		
		<dc:creator><![CDATA[Vijay K]]></dc:creator>
		<pubDate>Fri, 02 May 2025 07:18:43 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2FA]]></category>
		<category><![CDATA[AuthFramework]]></category>
		<category><![CDATA[BetterAuth]]></category>
		<category><![CDATA[FrameworkAgnostic]]></category>
		<category><![CDATA[MultiTenant]]></category>
		<category><![CDATA[OAUTH]]></category>
		<category><![CDATA[TypeScriptAuth]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=12215</guid>

					<description><![CDATA[<p>📌 What is Better Auth? Better Auth is a modern, open-source authentication and authorization framework designed for the TypeScript ecosystem. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/mastering-authentication-with-better-auth/">Mastering Authentication with Better Auth</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="446" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-6-1024x446.png" alt="" class="wp-image-12216" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-6-1024x446.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-6-300x131.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-6-768x334.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/05/image-6.png 1130w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4cc.png" alt="📌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> What is Better Auth?</h2>



<p class="wp-block-paragraph"><strong>Better Auth</strong> is a modern, open-source authentication and authorization framework designed for the TypeScript ecosystem. It provides a comprehensive set of features out of the box, including support for email/password authentication, social sign-on (OAuth), two-factor authentication (2FA), multi-tenancy, and more. Better Auth is framework-agnostic, meaning it can be integrated into various TypeScript-based frameworks such as Next.js, SvelteKit, Astro, and TanStack Start .</p>



<p class="wp-block-paragraph">The primary goal of Better Auth is to simplify the implementation of authentication systems by offering a robust, extensible, and type-safe solution. It allows developers to focus on building their applications without reinventing the wheel when it comes to user authentication and authorization.</p>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Major Use Cases of Better Auth</h2>



<ol class="wp-block-list">
<li><strong>Secure User Authentication</strong>: Implement secure login mechanisms using email/password, social logins (Google, GitHub, Apple, Discord), and more.</li>



<li><strong>Two-Factor Authentication (2FA)</strong>: Enhance security by adding an additional layer of authentication, such as SMS or authenticator apps.</li>



<li><strong>Multi-Tenant Applications</strong>: Manage organizations, teams, and access control for applications that serve multiple clients or user groups.</li>



<li><strong>Session Management</strong>: Handle user sessions with features like session expiration, revocation, and multi-session support.</li>



<li><strong>Custom Authentication Flows</strong>: Extend the authentication system with custom plugins to meet specific application requirements.</li>



<li><strong>Integration with Modern Frameworks</strong>: Seamlessly integrate with popular TypeScript frameworks, providing a consistent authentication experience across different platforms.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f9e0.png" alt="🧠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> How Better Auth Works – Architecture Overview</h2>



<p class="wp-block-paragraph">Better Auth operates as a backend authentication service that integrates with your application through a simple API. Here&#8217;s an overview of its architecture:</p>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f539.png" alt="🔹" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Core Components:</h3>



<ul class="wp-block-list">
<li><strong>Authentication Providers</strong>: Support for various authentication methods, including email/password, OAuth providers (Google, GitHub, etc.), and custom plugins.</li>



<li><strong>Session Management</strong>: Handles user sessions, including creation, expiration, and revocation.</li>



<li><strong>Database Integration</strong>: Utilizes databases like PostgreSQL, MySQL, or SQLite to store user data and session information.</li>



<li><strong>Plugin System</strong>: Allows for the extension of authentication functionalities through custom plugins.</li>



<li><strong>Rate Limiting</strong>: Built-in rate limiter to prevent abuse and ensure fair usage.</li>



<li><strong>Security Features</strong>: Includes features like 2FA, secure password hashing, and protection against common vulnerabilities.</li>
</ul>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f539.png" alt="🔹" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Data Flow:</h3>



<ol class="wp-block-list">
<li><strong>User Initiates Authentication</strong>: The user attempts to log in through the application interface.</li>



<li><strong>Authentication Request</strong>: The application sends an authentication request to the Better Auth service.</li>



<li><strong>Credential Verification</strong>: Better Auth verifies the provided credentials against the configured authentication providers.</li>



<li><strong>Session Creation</strong>: Upon successful authentication, Better Auth creates a session and returns a session token to the application.</li>



<li><strong>Access Granted</strong>: The application uses the session token to grant the user access to protected resources.</li>



<li><strong>Session Management</strong>: Better Auth manages the session lifecycle, including expiration and revocation.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f504.png" alt="🔄" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Basic Workflow of Better Auth</h2>



<ol class="wp-block-list">
<li><strong>Installation</strong>: Install the Better Auth package using npm or yarn. <code>npm install better-auth</code></li>



<li><strong>Configuration</strong>: Create an <code>auth.ts</code> file and configure Better Auth with your desired authentication methods and database connection. <code>import { betterAuth } from "better-auth"; export const auth = betterAuth({ database: new Pool({ connectionString: DATABASE_URL, }), emailAndPassword: { enabled: true, }, plugins: [ organization(), twoFactor(), ], });</code></li>



<li><strong>Session Management</strong>: Use the provided API to manage user sessions, including login, logout, and session validation. <code>const session = await auth.login({ email, password });</code></li>



<li><strong>Access Control</strong>: Implement access control mechanisms to restrict access to certain resources based on user roles or permissions.</li>



<li><strong>Extend Functionality</strong>: Utilize the plugin system to add custom authentication features as needed.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h2 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Step-by-Step Getting Started Guide for Better Auth</h2>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 1. <strong>Install Better Auth</strong></h3>



<p class="wp-block-paragraph">Install the Better Auth package in your project:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
npm install better-auth

</pre></div>


<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 2. <strong>Set Up Database</strong></h3>



<p class="wp-block-paragraph">Configure your database connection. Better Auth supports PostgreSQL, MySQL, and SQLite. For example, using PostgreSQL:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
import { Pool } from &quot;pg&quot;;

const db = new Pool({
  connectionString: process.env.DATABASE_URL,
});

</pre></div>


<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 3. <strong>Configure Authentication</strong></h3>



<p class="wp-block-paragraph">Create an <code>auth.ts</code> file and configure Better Auth with your desired authentication methods:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
import { betterAuth } from &quot;better-auth&quot;;

export const auth = betterAuth({
  database: db,
  emailAndPassword: {
    enabled: true,
  },
  socialProviders: {
    google: {
      clientId: process.env.GOOGLE_CLIENT_ID,
      clientSecret: process.env.GOOGLE_CLIENT_SECRET,
    },
  },
});

</pre></div>


<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 4. <strong>Implement Authentication Flows</strong></h3>



<p class="wp-block-paragraph">Use the provided API to implement authentication flows in your application:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
const session = await auth.login({ email, password });

</pre></div>


<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 5. <strong>Manage Sessions</strong></h3>



<p class="wp-block-paragraph">Handle session management, including creation, validation, and expiration:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
const user = await auth.getSession(sessionToken);

</pre></div>


<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 6. <strong>Extend Functionality with Plugins</strong></h3>



<p class="wp-block-paragraph">Add custom functionality using the plugin system:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
import { twoFactor } from &quot;better-auth/plugins&quot;;

auth.use(twoFactor());

</pre></div>


<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 7. <strong>Deploy and Monitor</strong></h3>



<p class="wp-block-paragraph">Deploy your application and monitor authentication activities using the provided tools and dashboards.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/mastering-authentication-with-better-auth/">Mastering Authentication with Better Auth</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/mastering-authentication-with-better-auth/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Authentication Types in Gerrit explained!</title>
		<link>https://www.scmgalaxy.com/tutorials/authentication-types-in-gerrit-explained/</link>
					<comments>https://www.scmgalaxy.com/tutorials/authentication-types-in-gerrit-explained/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Sun, 19 Aug 2018 19:38:36 +0000</pubDate>
				<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[CLIENT_SSL_CERT_LDAP]]></category>
		<category><![CDATA[DEVELOPMENT_BECOME_ANY_ACCOUNT]]></category>
		<category><![CDATA[HTTP_LDAP]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[LDAP_BIND]]></category>
		<category><![CDATA[OAUTH]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[OpenID_SSO]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5159</guid>

					<description><![CDATA[<p>Authentication Types in Gerrit explained! Type of user authentication employed by Gerrit. The supported values are: By default, OpenID OpenID [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/authentication-types-in-gerrit-explained/">Authentication Types in Gerrit explained!</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignnone size-full wp-image-5251" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/gerrit1.png" alt="" width="600" height="350" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/gerrit1.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/gerrit1-300x175.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>Authentication Types in Gerrit explained!</p>
<p>Type of user authentication employed by Gerrit. The supported values are:</p>
<p><strong>By default, OpenID</strong></p>
<p><strong>OpenID</strong><br />
The default setting. Gerrit uses any valid OpenID provider chosen by the end-user. For more information see openid.net.<br />
<strong>OpenID_SSO</strong><br />
Supports OpenID from a single provider. There is no registration link, and the &#8220;Sign In&#8221; link sends the user directly to the provider’s SSO entry point.<br />
<strong>HTTP</strong><br />
Gerrit relies upon data presented in the HTTP request. This includes HTTP basic authentication, or some types of commercial single-sign-on solutions. With this setting enabled the authentication must take place in the web server or servlet container, and not from within Gerrit.<br />
<strong>HTTP_LDAP</strong><br />
Exactly like HTTP (above), but additionally Gerrit pre-populates a user’s full name and email address based on information obtained from the user’s account object in LDAP. The user’s group membership is also pulled from LDAP, making any LDAP groups that a user is a member of available as groups in Gerrit.<br />
<strong>CLIENT_SSL_CERT_LDAP</strong><br />
This authentication type is actually kind of SSO. Gerrit will configure Jetty’s SSL channel to request the client’s SSL certificate. For this authentication to work a Gerrit administrator has to import the root certificate of the trust chain used to issue the client’s certificate into the &lt;review-site&gt;/etc/keystore. After the authentication is done Gerrit will obtain basic user registration (name and email) from LDAP, and some group memberships. Therefore, the &#8220;_LDAP&#8221; suffix in the name of this authentication type. This authentication type can only be used under hosted daemon mode, and the httpd.listenUrl must use https:// as the protocol. Optionally, certificate revocation list file can be used at &lt;review-site&gt;/etc/crl.pem. For details, see httpd.sslCrl.<br />
<strong>LDAP</strong><br />
Gerrit prompts the user to enter a username and a password, which it then verifies by performing a simple bind against the configured ldap.server. In this configuration the web server is not involved in the user authentication process.<br />
The actual username used in the LDAP simple bind request is the account’s full DN, which is discovered by first querying the directory using either an anonymous request, or the configured ldap.username identity. Gerrit can also use kerberos if ldap.authentication is set to GSSAPI.<br />
<strong>LDAP_BIND</strong><br />
Gerrit prompts the user to enter a username and a password, which it then verifies by performing a simple bind against the configured ldap.server. In this configuration the web server is not involved in the user authentication process.<br />
Unlike LDAP above, the username used to perform the LDAP simple bind request is the exact string supplied in the dialog by the user. The configured ldap.username identity is not used to obtain account information.<br />
<strong>OAUTH</strong><br />
OAuth is a protocol that lets external apps request authorization to private details in a user’s account without getting their password. This is preferred over Basic Authentication because tokens can be limited to specific types of data, and can be revoked by users at any time.<br />
Site owners have to register their application before getting started. Note that provider specific plugins must be used with this authentication scheme.<br />
<strong>DEVELOPMENT_BECOME_ANY_ACCOUNT</strong><br />
DO NOT USE. Only for use in a development environment.<br />
When this is the configured authentication method a hyperlink titled Become appears in the top right corner of the page, taking the user to a form where they can enter the username of any existing user account, and immediately login as that account, without any authentication taking place. This form of authentication is only useful for the GWT hosted mode shell, where OpenID authentication redirects might be risky to the developer’s host computer, and HTTP authentication is not possible.</p>
<p><strong>Reference</strong><br />
https://dev.vaadin.com/review/Documentation/config-gerrit.html#auth</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/authentication-types-in-gerrit-explained/">Authentication Types in Gerrit explained!</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/authentication-types-in-gerrit-explained/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
