Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 2.27 KB

Authentication.md

File metadata and controls

34 lines (26 loc) · 2.27 KB

Authentication Extension

This extension specification is currently incubating. While incubating the version is 0.

Introduction

Authentication is a necessary component to any real world application. This extension specification provides a standardized mechanism for including both the type of credentials and the credentials in metadata payloads.

Metadata Payload

This metadata type can be used in a per connection or per stream, and not individual payloads and as such it MUST only be used in frame types used to initiate interactions and payloads. This includes SETUP, REQUEST_FNF, REQUEST_RESPONSE, REQUEST_STREAM, and REQUEST_CHANNEL. The Metadata MIME Type is message/x.rsocket.authentication.v0.

Metadata Contents

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |A| Auth ID/Len |   Authentication Type                        ...
    +---------------+---------------+---------------+---------------+
    |                     Authentication Payload                   ...
    +---------------+-----------------------------------------------+
  • (A)uthentication Type: Authentication type is a well known value represented by a unique integer. If A flag is set (a value of 1), indicates a Well-known Auth Type ID. If A flag is not set (a value of 0), indicates the Authentication Type Length in bytes.
  • Auth ID/Length: (7 bits = max value 2^7 = 128) Unsigned 7-bit integer. If A flag is set (a value of 1), indicates a Well-known Auth Type ID. If A flag is not set (a value of 0), indicates the Authentication Type Length in bytes.
  • Authentication Type: the type of authentication encoding. This SHOULD be a US-ASCII string. The string MUST NOT be null terminated. (Not present if A flag is set)
  • Authentication Payload: The authentication payload encoded as defined by the Authentication Encoding Type.