English | 简体中文
You can use Authing to quickly integrate authentication capabilities for new or existing React applications. This demo will show you how to use the Authing Browser SDK to add authentication capabilities to your React application.
In the Authing Console's self-built application, modify your application settings:
- Authentication Configuration: configure the
Login Callback URL
tohttps://localhost:3000
- Authorization Configuration:
Authorization Flow
Selectauthorization_code
andrefresh_token
- Authorization Configuration:
Return Type
selectcode
In the /.env
configuration file, fill in your app configuration:
# App ID
REACT_APP_SDK_APPID = App ID
# App's authentication address
REACT_APP_SDK_DOMAIN = authentication address
# Login Callback URL
REACT_APP_SDK_REDIRECT_URI = Login Callback URL
# The permissions requested by the app to Authing, separated by spaces,
# the default is 'openid profile' Permissions successfully obtained will
# appear in the scope field of the Access Token
REACT_APP_SDK_SCOPE = openid profile order:read
# API for verifying that the Access Token has permission to access.
# For example: http://localhost:5000/api/protected
REACT_APP_RESOURCE_API = resource api
$ yarn install
$ yarn start
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push -u origin my-new-feature)
- Create new Pull Request
Copyright (c) 2019-present, Authing