Libraries tagged by brody

daphascomp/daphascompsms

0 Favers
2 Downloads

# Authentication Requests made to our APIs must be authenticated, there are two ways to do this: 1. Authenticating using your API apiUsername and apiPassword - `Basic Auth` 2. Authenticating using an Auth Token - `Bearer Token` ## Method 1: Basic Auth Basic Authentication is a method for an HTTP user agent (e.g., a web browser) to provide a apiUsername and apiPassword when making a request. When employing Basic Authentication, users include an encoded string in the Authorization header of each request they make. The string is used by the request’s recipient to verify users’ identity and rights to access a resource. The Authorization header follows this format: > Authorization: Basic base64(apiUsername:apiPassword) So if your apiUsername and apiPassword are `onfon` and `!@pas123`, the combination is `onfon:!@pas123`, and when base64 encoded, this becomes `b25mb246IUBwYXMxMjM=`. So requests made by this user would be sent with the following header: > Authorization: Basic b25mb246IUBwYXMxMjM= | Description | | ---------------------------------------------------------------------------------------------- | | **apiUsername** `String` `Required` Your onfon account apiUsername, retrieved from portal | | **apiPassword** `String` `Required` Your onfon account apiPassword, retrieved from portal | ## Method 2: Bearer Tokens This authentication stategy allows you to authenticate using JSON Web Token ``JWT` that will expire after given duration. Each Access Token is a `JWT`, an encoded JSON object with three parts: the `header`, the `payload`, and the `signature`. The following is an example Access Token generated for Conversations > Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c ### Getting the token To generate the token, make a `POST` request to `/v1/authorization` endpoint with your `apiUsername` and `apiPassword` This request should be made from your server and not on the client side such as browser or mobile environment. You will receive a JSON similar to below: `{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "validDurationSeconds": 3600}` You can use the token received to make API calls. The token will be valid for value of `validDurationSeconds`, before which you should generate a new token. #### Request Body ``` { "apiUsername": "root", "apiPassword": "hakty11" } ``` #### Response Body ``` { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", "validDurationSeconds": 3600 } ``` #### Example Curl ``` curl --location --request POST 'https://apis.onfonmedia.co.ke/v1/authorization' \ --data-raw '{ "apiUsername": "correctapiUsername", "apiPassword": "correctapiPassword" } ``` #### Making an API call You will be required to pass the token in `Authorization` header prefixed by `Bearer` when calling other endpoints. Example `Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c`

Go to Download


ctw/ctw-middleware-tidy

1 Favers
92 Downloads

This PSR-15 middleware formats, fixes and beautifies the HTML in the Response body using HTML Tidy.

Go to Download


ctw/ctw-middleware-htmlminifier

1 Favers
96 Downloads

This PSR-15 middleware formats, fixes and beautifies the HTML in the Response body using a variety of adapters.

Go to Download


conejerock/idempotency-bundle

0 Favers
12 Downloads

Check idempotency keys in headers/body/query requests

Go to Download


cexll/hyperf-apihash

1 Favers
8 Downloads

API Response Body Hash In (RSA AND AES)

Go to Download


cexll/hash-encode

0 Favers
10 Downloads

hash response body

Go to Download


bugbuster/mobiledetection

1 Favers
139 Downloads

Contao helper class for detecting mobile phones and tablets (device type). A Hook adds a CSS class in the body tag.

Go to Download


broken-titan/laravel-header-paginate

0 Favers
7 Downloads

Transforms the default pagination of the Laravel responses from body metadata to the Link header.

Go to Download


boubacamara/ganega-http

0 Favers
9 Downloads

Provides simple and intuitive classes for handling HTTP requests and responses in PHP applications. The Request class encapsulates HTTP request data, making it easy to manage and access parameters, body, session, cookies, and server information. The Response class simplifies the creation and management of HTTP responses, allowing you to set content, status codes, and headers effortlessly.

Go to Download


binsoul/net-http-response

0 Favers
26 Downloads

Specialized response and body classes plus response emitter

Go to Download


bdus-db/bdus-api-php-client

0 Favers
5 Downloads

A simple to use PHP client for Bradypus API

Go to Download


badcamp/badcamp_blog

0 Favers
619 Downloads

Provides a Feature with content type and view for showing news content. Details include a title, body, and tag field. Also installs taxonomy term (Drupal Planet).

Go to Download


backdrop-dev/attr

0 Favers
25 Downloads

Backdrop Attr provides devs a system for adding filterable attributes. This is sort of like `body_class()`, `post_class()`, and `comment_class()` on steroids.

Go to Download


avlima/dingo-api

0 Favers
859 Downloads

A fork from a RESTful API package for the Laravel and Lumen frameworks without auth with query and prints the status code in the body of the response

Go to Download


avanzu/json-request-bundle

1 Favers
10 Downloads

EventListener to convert a json request body into regular request params

Go to Download


<< Previous Next >>