<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Guilherme Alves</title>
    <description>The latest articles on DEV Community by Guilherme Alves (@srdevgui).</description>
    <link>https://dev.to/srdevgui</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3613859%2F735d3524-435d-484e-b689-de8460cb17fb.jpeg</url>
      <title>DEV Community: Guilherme Alves</title>
      <link>https://dev.to/srdevgui</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/srdevgui"/>
    <language>en</language>
    <item>
      <title>An Authentication Hub - A brief summary</title>
      <dc:creator>Guilherme Alves</dc:creator>
      <pubDate>Mon, 03 Aug 2026 23:55:18 +0000</pubDate>
      <link>https://dev.to/srdevgui/an-authentication-hub-a-brief-summary-lok</link>
      <guid>https://dev.to/srdevgui/an-authentication-hub-a-brief-summary-lok</guid>
      <description>&lt;p&gt;In this article, you will learn how an Authentication Hub works.&lt;/p&gt;

&lt;p&gt;To start, let’s define what an Authentication Hub is: imagine your company has various types of applications, such as accounting systems and identity management systems, among others. &lt;em&gt;You need to grant access to these applications to each employee, but each individual should only access the ones relevant to their role&lt;/em&gt;. And that is &lt;strong&gt;what an authentication hub does&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fld88mb9kxc3vigtbgrjc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fld88mb9kxc3vigtbgrjc.png" alt="Authentication Hub" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An Authentication Hub centralizes authentication and authorization, ensuring that users can only access the resources they are permitted to use. Access decisions are typically based on &lt;strong&gt;Role-Based Access Control (RBAC)&lt;/strong&gt;, where permissions are assigned according to a user's role (for example, Accountant or HR Manager), and can be further refined using &lt;strong&gt;Attribute-Based Access Control (ABAC)&lt;/strong&gt;, which evaluates additional attributes such as department, location, employment status, time of day, or device compliance.&lt;/p&gt;

&lt;p&gt;To build a secure Authentication Hub, we need a trusted key management system. In this article, we will use &lt;a href="https://azure.microsoft.com/en-us/products/key-vault" rel="noopener noreferrer"&gt;Azure Key Vault&lt;/a&gt; as the reference implementation.&lt;/p&gt;

&lt;p&gt;The core idea is to issue &lt;strong&gt;digitally signed JSON Web Tokens (JWTs)&lt;/strong&gt; that allow applications to verify a user's identity without storing authentication state. The private signing key is securely protected inside Azure Key Vault and never leaves the service. Applications validate the token &lt;strong&gt;using the corresponding public key&lt;/strong&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since public keys cannot be used to generate valid signatures, they can be safely distributed through the JWKS endpoint.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ensuring that the token was issued by a trusted authority and has not been tampered with.&lt;br&gt;
&lt;strong&gt;Flow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F029491fxcbeu7p30l8cy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F029491fxcbeu7p30l8cy.png" alt="Authentication Hub flow" width="799" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An important aspect of this architecture is &lt;strong&gt;key rotation&lt;/strong&gt;. Cryptographic keys should never remain valid indefinitely. Azure Key Vault allows signing keys to be rotated periodically, reducing the impact of a compromised key and following security best practices. During rotation, new tokens are signed with the new private key, while previously issued tokens remain valid because their corresponding public keys continue to be published through the &lt;strong&gt;JWKS (JSON Web Key Set)&lt;/strong&gt; endpoint until all older tokens have expired. This enables seamless key updates without interrupting authenticated sessions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff8c65wzs5is535ith268.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff8c65wzs5is535ith268.png" alt="Key and tokens details" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building an Authentication Hub around industry standards such as OAuth 2.0, OpenID Connect, JWT, and JWKS provides a secure, scalable, and maintainable authentication architecture. By keeping private keys inside a dedicated vault service and distributing only public keys for validation, applications can authenticate users efficiently without exposing sensitive cryptographic material.&lt;/p&gt;

&lt;p&gt;Although this article used Azure Key Vault as the reference implementation, the same architecture can be applied to virtually any enterprise-grade key management solution, such as &lt;a href="https://www.hashicorp.com/en" rel="noopener noreferrer"&gt;HashiCorp Vault&lt;/a&gt;, &lt;a href="https://aws.amazon.com/kms/" rel="noopener noreferrer"&gt;AWS KMS&lt;/a&gt;, &lt;a href="https://cloud.google.com/security/products/security-key-management" rel="noopener noreferrer"&gt;Google Cloud KMS&lt;/a&gt;, or other Hardware Security Module (HSM)-backed services.&lt;/p&gt;

</description>
      <category>authenticationhb</category>
      <category>keyvalt</category>
      <category>microsoft</category>
      <category>security</category>
    </item>
    <item>
      <title>WebRTC - onicecandidate curiosity</title>
      <dc:creator>Guilherme Alves</dc:creator>
      <pubDate>Tue, 30 Dec 2025 17:03:31 +0000</pubDate>
      <link>https://dev.to/srdevgui/webrtc-onicecandidate-curiosity-439m</link>
      <guid>https://dev.to/srdevgui/webrtc-onicecandidate-curiosity-439m</guid>
      <description>&lt;p&gt;If you start to work with WebRTC you'll notice that &lt;code&gt;onicecandidate&lt;/code&gt; returns many types of candidates, I was wondering what are they, because in my case the connection involves only 2 phones, but I receive many other candidates.&lt;br&gt;
If you work with this event you'll probably code something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrjw59usbr4s0qok1esl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrjw59usbr4s0qok1esl.png" alt="my code that represents the onicecandidate event" width="800" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which represents the phase that you see other candidates in the server. &lt;br&gt;
According to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/icecandidate_event" rel="noopener noreferrer"&gt;MDN It does&lt;/a&gt; : &lt;em&gt;"fired to indicate that a new candidate has been gathered. This candidate needs to be delivered to the remote peer over the signaling channel your code manages."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Okay, now if we look to the logs, we'll see something like this : &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbsrbhneoya7727sw3ej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbsrbhneoya7727sw3ej.png" alt="console.log() showing the prints of the event" width="800" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here comes my questions. What I discover after reading the docs is that this other candidates are simply other routes from the same phone (or any device) to ensure that the connection will occur.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do several appear :&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The device has multiple interfaces (Wi-Fi, phone, IPv4, and IPv6), and each interface generates a "host" candidate.&lt;/li&gt;
&lt;li&gt;The STUN server map uses the public IP/NAT and generates "srflx" (server-reflexive) type candidates.&lt;/li&gt;
&lt;li&gt;If there is a TURN, "relay" candidates appear.&lt;/li&gt;
&lt;li&gt;ICE can also generate "prflx" candidates during P2P checks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Expected behavior :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ICE will try all options and choose the one that works best; manual filtering is not necessary in most cases.&lt;/p&gt;

&lt;p&gt;In this phase you must send this candidate (which will be picked automatically) to your backend server (probably a WebSocket). MDN docs also said the same:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03fwlb3xa9wh2jylgo4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03fwlb3xa9wh2jylgo4u.png" alt="The official documents of MDN showing the instructions" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case I'm sending a &lt;em&gt;webrtc_ice_candidate&lt;/em&gt; type message to indicate that a new candidate has gathered.&lt;/p&gt;

</description>
      <category>webrtc</category>
      <category>programming</category>
      <category>webdev</category>
      <category>rtcpeerconnection</category>
    </item>
  </channel>
</rss>
