Class: Agora::AgoraDynamicKey2::FpaTokenBuilder
- Inherits:
-
Object
- Object
- Agora::AgoraDynamicKey2::FpaTokenBuilder
- Defined in:
- lib/agora/dynamic_key2/fpa_token_builder.rb
Class Method Summary collapse
-
.build_token(app_id, app_certificate) ⇒ Object
Build the FPA token.
Class Method Details
.build_token(app_id, app_certificate) ⇒ Object
Build the FPA token.
from your kit. See Get an App ID. See Get an App Certificate.
11 12 13 14 15 16 17 18 19 |
# File 'lib/agora/dynamic_key2/fpa_token_builder.rb', line 11 def self.build_token(app_id, app_certificate) access_token = Agora::AgoraDynamicKey2::AccessToken.new(app_id, app_certificate, 24 * 3600) service_fpa = Agora::AgoraDynamicKey2::ServiceFpa.new service_fpa.add_privilege(Agora::AgoraDynamicKey2::ServiceFpa::PRIVILEGE_LOGIN, 0) access_token.add_service(service_fpa) access_token.build end |