Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openmobilehub/auth-microsoft

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openmobilehub/auth-microsoft

React Native OMH Auth - Microsoft streamlines Microsoft authentication integration into React Native applications.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source


React Native OMH Auth - Microsoft

NPM downloads NPM version License

Chat on Discord Follow on Twitter


Installation

npm add @openmobilehub/auth-microsoft

Configuration

:::info[Prerequisites]

Each plugin requires you to follow the iOS and Android configuration prior to interacting with it.

:::

Console App

To access Google APIs, please follow these steps in order to obtain the Client ID:

  1. Create a new app in Microsoft Azure. Make sure to set the Account Type to: "Accounts in any organizational directory (Any Microsoft Entra directory - Multitenant) and personal Microsoft accounts (such as Skype, Xbox)".
  2. Add the Android platform and specify your Package Name and Signature Hash for your app.
  3. Add the iOS / macOS platform and specify your Bundle ID for your app.
  4. Download the ms_auth_config.json file and add it in the android/app/src/main/res/raw directory.

Android

Add a new entry to your android/local.properties file:

MICROSOFT_SIGNATURE_HASH=<YOUR_MICROSOFT_SIGNATURE_HASH>

Usage

Initializing

Before interacting with Microsoft, initialization of the Microsoft Auth Client is necessary, requiring platform specific configuration to be set.

import MicrosoftAuthClient from '@openmobilehub/auth-microsoft';

await MicrosoftAuth.initialize({
  android: {
    scopes: ['User.Read'],
    configFileName: 'ms_auth_config',
  },
  ios: {
    scopes: ['User.Read', 'openid', 'profile', 'email', 'offline_access'],
    clientId: '<YOUR_MICROSOFT_CLIENT_ID>',
    redirectUrl: 'msauth.com.omh.auth.sample://auth/',
  },
});

Other methods

:::warning[Known limitations"]

Due to current limitations to the underlying Microsoft SDK, revoking a token is not supported as of now. Instead an error with the "Method not supported." message will be thrown when calling the revokeAccessToken method.

:::

Interacting with the Microsoft provider follows the same pattern as other providers since they all implement the IAuthModule interface. For a comprehensive list of available methods, refer to the Quick Start guide.

License

FAQs

Package last updated on 09 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc