Comments (1)
Just create your own implementation of interface IAuthorizer (you can use HttpAuthorizer as a start). Then just add anything you like to the Authorize() function, like:
public class MyAuthorizer : IAuthorizer
{
private Uri _authEndpoint;
public MyAuthorizer (string authEndpoint)
{
_authEndpoint = new Uri(authEndpoint);
}
public string Authorize(string channelName, string socketId)
{
string authToken = null;
using (var webClient = new System.Net.WebClient())
{
string data = String.Format("channel_name={0}&socket_id={1}", channelName, socketId);
webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
webClient.Headers[HttpRequestHeader.Accept] = "application/json";
webClient.Headers[HttpRequestHeader.Authorization] = "my_auth_code";
authToken = webClient.UploadString(_authEndpoint, "POST", data);
}
return authToken;
}
}
from pusher-websocket-dotnet.
Related Issues (20)
- precenceCannel.member does not exist HOT 2
- ConnectAsyn exception HOT 2
- How to bind to "pusher: subscription_succeeded" event? HOT 2
- Mixing events HOT 3
- Deadlock when unsibscribe from channels HOT 5
- A call to SSPI could not be made; see inner exception (.NET Framework 4.5 and 4.7.2) HOT 3
- Buggy Pusher Client 2.0.0 NuGet HOT 1
- Update from 1.2 to 2.1 changed JSON structure HOT 2
- SemaphoreFullException HOT 7
- RemoteCertificateChainErrors with PusherClient in Xamarin forms HOT 4
- NullReferenceException when disposing websocket HOT 4
- ArgumentNullException HOT 2
- PusherClient 2.1.0 doesn't decrypts messages HOT 1
- Error when subscribing to channels from ios platform app HOT 3
- Reporting a vulnerability HOT 1
- Blazor WASM unable to connect HOT 2
- Unable to save excel file with pictures. HOT 1
- 403 Forbidden should be handled when authenticating user HOT 1
- System.InvalidOperationException (Connection.websocket_Opened) HOT 8
- Backoff delay never reset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pusher-websocket-dotnet.