OAuth2 allows to third-party applications to get access to restricted resources using HTTP protocol. RFC 6749 covers OAuth2 specification. There are 4 roles:
(A) The client requests authorization from the resource owner. The authorization request can be made directly to the resource owner (as shown), or preferably indirectly via the authorization server as an intermediary.
(B) The client receives an authorization grant, which is a credential representing the resource owner's authorization, expressed using one of four grant types defined in this specification or using an extension grant type. The authorization grant type depends on the method used by the client to request authorization and the types supported by the authorization server.sgcWebSockets supports Bearer tokens in WebSocket client component. You only must enable Authentication and Token property in TsgcWebSocketClient and set which token will be sent when client connects to server.
Client := TsgcWebSocketClient.Create(nil); Client.Authentication.Enabled := True; Client.Authentication.Token.Enabled := True; Client.Authentication.Token.AuthName := 'Bearer'; Client.Authentication.Token.AuthToken := '<your token here>';
Next version, sgcWebSockets 4.3.4, a new component for OAuth2 will be released and will be able to get OAuth2 credentials automatically.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.