Authorize with secret key
tnt-ndricimh opened this issue · 5 comments
Code from iOS sdk. Do we have something similar in Android sdk?
let options = PusherClientOptions(authMethod: .inline(secret: Constants.SOCKET_SECRET), host: .cluster("eu"))
pusher = Pusher(key: Constants.SOCKET_APP_KEY, options: options)
pusher.delegate = self
let channel = pusher.subscribe(Constants.SOCKET_CHANNEL)```
CC @pusher/mobile
Can you specify specifically what you are looking for?
We are using Pusher for a chat in our application. We are using private channels, which for usage require an authentication method. iOS guys are using for authMethod with secret key, created when setting up Pusher. Android sdk only offers authentication via endpoint url.
public HttpChannelAuthorizer(final String endPoint) { super(endPoint); }
iOS is supporting 4 Authentication types (Code from iOS sdk)
public enum AuthMethod {
case endpoint(authEndpoint: String)
case authRequestBuilder(authRequestBuilder: AuthRequestBuilderProtocol)
case authorizer(authorizer: Authorizer)
case inline(secret: String)
case noMethod
}
The question is how can we setup pusher options authentication with Pusher Secret key? @benw-pusher
It is not currently possible to implement this in the way you are looking, I will raise this internally to see if we can identify any solutions here.
We ended using the case with endpoint in both platforms. We noticed the iOS sdk has a cleaner code and build a little better. Something that you can raise internally is migrating the sdk to Kotlin. This will make it easier for the developers to use and also you because you can maintain it easier. You can close the issue if you want since is looking more like a feature request than an issue
Thanks for getting back. We agree that this looks like a feature req, I have raised this internally for review however we can't commit to a timeframe or release at this stage.