Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
Simple username/password transmission
Credentials encoded in Base64
Sent via HTTP Authorization header.
Single token for identifying application/user
Can be sent via Request headers or
Query parameters
Uses access tokens for authorization typically JWT-based
Stateless authentication mechanism.
My Approach
New Models
I created new models (
AuthorizationModel
) with various submodels (BasicAuthModel
,BearerAuthModel
,ApikeyAuthModels
). These are data models that handle data entered by users.AuthorizationModel
has fieldsAuthType
authType - The type of authorization.Bool
isEnabled - Is authorization enabled for selected request?BasicAuthModel
basicAuthModel - stores data for basic authorization typeBearerAuthModel
bearerAuthModel - stores data for bearer authorization typeApikeyAuthModel
apikeyAuthModel - stores data for api key authorization typeStateProviders
AuthorizationProvider
for managing the state of the Authorization typesupdate
method to update fields within the Authorization model_syncwithRequest
method to sync these values with the selectedRequestModel
User Interface
A Tab for enabling and including the various Authorization tabs, currently implemently in this draft PR:
A Visual Summary of My Approach
In this image, I have visually presented my approach to this draft PR.

A Video Demo
In this video, I demonstrate how to enable Authorization for Basic Authorization as well as Bearer Token Authorization. Nasa and Postman Public APIs were used as they support these types of authorization.
I attempted to upload the video here several times, somehow, it wasn't working, hence I have placed the video in this Gdrive:
Link to Video Demo
As I progress through this contribution more authorization types will be incrementally added.
Related Issues
Checklist
main
branch before making this PRflutter upgrade
and verify)flutter test
) and all tests are passingAdded/updated tests?
OS on which you have developed and tested the feature?