SOFA - Simple OAuth 2.0 Framework for Authentication (Freeware)
Last updated
Last updated
This class implements a small and easy to use framework to support Java applications with OAuth 2.0 for machine-to-machine (M2M) or service-to-service authentication.
Requires Java version 1.8 or higher.
Uses plain HTTP protocol to implement OAuth 2.0 client calls. Only grant types which do not require any user interactions are supported (client_credentials
and password)
.
Once authenticated at the OAuth 2.0 authorization server, getAccessToken()
returns the current access token or transparently calls the authorization server to obtain a new access token, if it is expired.
All confidential data used in this class is stored in temporary, volatile memory (RAM) protected by AES-256 encryption.
Use this class only in trusted environments, since the calling application need to pass confidential data (e.g. client secret and/or user password) to the SOFA class for authentication.
This framework was created to help implementing projects which required the use of OAuth 2.0 authentication. If you encounter any issue or if you have a suggestion, please let me know.
The standard Java Logger framework (not the Apache Log4j) is supported by writing log entries with Level.FINE
and Level.WARNING
. Logging is enabled by adding a configuration file SOFA-Logging.properties
which is read from the current directory (see ). No confidential data is written to the log.
You may contact me via my email address .
SOFA is and . It was created with love and passion in the beautiful country of 🇨🇭 Switzerland. This software shall be used for Good not Evil. As far as I know, no animal was harmed in the making of this software 😊
Photo by on