mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 13:41:53 +01:00
91307993ad
Upgrades UoM dependencies to: * javax.measure 2.1.2 * si-units 2.0.1 * indriya 2.1.2 An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers. Notable changes: * Quantity not longer implements an `equals` method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead. * RationalConverter is not package private, so instances of it much be created through the MultiplyConverter static functions. * Quantities.getQuantity can no longer parse values without units like `100`. A workaround has been implemented. * The unicode greek `mu` letter is now returned for unit prefixes instead of the unicode `micro` character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine. Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com> Signed-off-by: Wouter Born <github@maindrain.net> |
||
---|---|---|
.. | ||
src/main/java/org/openhab/core/auth/oauth2client/test/internal | ||
.classpath | ||
.project | ||
itest.bndrun | ||
NOTICE | ||
pom.xml | ||
README.md |
This is a working bundle for demonstrating/ testing the OAuth2 client. Passwords, secrets, etc have to be configured through config admin in order for it to work
Simply deploy it to the runtime; then openhab:oauth commands will be registered and ready to test.
Example 1: (Using authorization code)
Try these on the OSGI console:
openhab:oauth Code cleanupEverything
openhab:oauth Code create
openhab:oauth Code getClient <fill in handle from create step>
openhab:oauth Code getAuthorizationUrl
now open browser with the URL from above step, authenticate yourself
to a real oauth provider
if everything works properly, it should redirect you to your redirectURL
Read the code http parameter from the redirectURL
openhab:oauth Code getAccessTokenByCode <code from redirectURL parameter>
openhab:oauth Code getCachedAccessToken
openhab:oauth Code refresh
openhab:oauth Code close
Example 2: (Using ResourceOwner credentials i.e. you have the user's username and password directly)
Try these on the OSGI console:
openhab:oauth ResourceOwner create
openhab:oauth ResourceOwner getClient <fill in handle from create step>
openhab:oauth ResourceOwner getAccessTokenByResourceOwnerPassword
openhab:oauth ResourceOwner getCachedAccessToken
openhab:oauth ResourceOwner refresh
openhab:oauth ResourceOwner close
load again, similar to reboot/restart
openhab:oauth ResourceOwner getClient <fill in handle from create step>
openhab:oauth ResourceOwner getCachedAccessToken
openhab:oauth ResourceOwner refresh
Done playing, delete this service permanently
openhab:oauth ResourceOwner delete <fill in handle from create step>
Verify this is deleted (will throw exception)
openhab:oauth ResourceOwner getCachedAccessToken
Cannot get the client after delete
openhab:oauth ResourceOwner getClient <fill in handle from create step>