You want to integrate your Android app with Facebook Android SDK, Google Play Services or Firebase. With Facebook, you need to config key hash. You can use Facebook manual to get your own key hash or read my blog.
How to download Android Keytool?
Go to Android Keytool’s GitHub repo. Select release tab and download latest .jar file. After download tool, you can open and start using tool. See video demo here. So easy!
Có thể do các API tạo bằng JHipster để dùng trên môi trường web, nên sinh ra cookie là XSRF-TOKEN. Mỗi khi gửi request lên API thì Header có kèm thêm field X-XSRF-TOKEN, value của field này được lấy từ cookie XSRF-TOKEN. JHipster đã làm sẵn cho ta các bước này. Ngoài ra, API còn sử dụng thêm session JSESSIONID để verify request. Nhưng khi gọi API trên Android/iOS, ta phải tự làm các bước giống như trên. Gọi 1 API bất kỳ để sinh ra cookie XSRF-TOKEN. Ta cần lấy tất cả cookie từ response header, lưu lại để dùng cho các request sau. Khi tạo request mới, thì gán các cookie đã lưu vào request header. Ngoài ra, ta cần tìm cookie XSRF-TOKEN, lấy value gán cho field X-XSRF-TOKEN ở request header. Khi có response ở bước 2, ta lặp lại bước 1. Khi lưu và lấy cookie cần lưu theo domain để tránh trùng cookie do API sinh ra với cookie do website khác sinh ra. Ví dụ thực tế trên iOS: JHipster sinh ra session JSESSIONID, ta lưu cookie vào NSHTTPCookieStorage và không theo domain. (1) Mở 1 ...
Nếu bạn đang configure port cho SSH, sau đó restart lại sshd mà gặp báo lỗi kiểu như thế này Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Thì hãy chạy lệnh journalctl -xe để xem báo lỗi cụ thể là gì nhé. Giả sử ta đang configure port number là 9999, lúc này báo lỗi sẽ có dạng Dec 04 22:25:16 localhost sshd[25003]: error: Bind to port 9999 on 0.0.0.0 failed: Permission denied. Dec 04 22:25:16 localhost sshd[25003]: error: Bind to port 9999 on :: failed: Permission denied. Dec 04 22:25:16 localhost sshd[25003]: fatal: Cannot bind any address. Dec 04 22:25:16 localhost systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a Dec 04 22:25:16 localhost systemd[1]: Failed to start OpenSSH server daemon. -- Subject: Unit sshd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -...
Khi cài đặt PHP trên CentOS 7/RHEL 7 sẽ mặc định cài PHP 5.4. Nếu muốn cài đặt PHP 7.2 thì cần làm theo các bước bên dưới 1. Cài đặt EPEL repo sudo yum install -y epel-release 2. Cài đặt Remi repo cho PHP sudo yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm 3. Cài đặt package yum-utils sudo yum install -y yum-utils 4. Enable Remi repo sudo yum-config-manager --enable remi-php72 5. Chạy yum update sudo yum -y update 6. Cài đặt PHP 7.2 và các package thường xuyên sử dụng (có thể thêm / bớt tùy ý) sudo yum install -y php72 php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache php-cli 7. Kiểm tra phiên bản của PHP sau khi cài đặt php -v Cửa sổ dòng lệnh hiển thị như bên dưới là cài đặt thành công PHP 7.2.34 (cli) (built: Aug 25 2021 15:37:58) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies Bên dưới là tất cả các lện...
Nhận xét
Đăng nhận xét