Class: AgoraDynamicKey2::FpaTokenBuilder
- Inherits:
-
Object
- Object
- AgoraDynamicKey2::FpaTokenBuilder
- Defined in:
- lib/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.
10 11 12 13 14 15 16 17 18 |
# File 'lib/dynamic_key2/fpa_token_builder.rb', line 10 def self.build_token(app_id, app_certificate) access_token = AgoraDynamicKey2::AccessToken.new(app_id, app_certificate, 24 * 3600) service_fpa = AgoraDynamicKey2::ServiceFpa.new service_fpa.add_privilege(AgoraDynamicKey2::ServiceFpa::PRIVILEGE_LOGIN, 0) access_token.add_service(service_fpa) access_token.build end |