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

@coreo/ionic-auth

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coreo/ionic-auth

Ionic 2+ module for authorising a user with Coreo.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@coreo/ionic-auth

Ionic 2+ module for integrating with Coreo via email/facebook/google/etc.

Installation

npm install @coreo/ionic-auth

Usage

Import the module in your app.module.ts:

import { CoreoAuthModule } from '@coreo/ionic-auth';
...
@NgModule({
    imports: [
        ...
        CoreoAuthModule
        ...
    ]
})
export class AppModule {}

Setting up OAuth providers

Facebook

  • In your Ionic project, make sure you have a widget ID setup in your config.xml file.
  • Go to https://developers.facebook.com. In the top right hand corner, hover over 'My Apps' and choose 'Add a New App'. Follow through the wizard to set up the app, don't add any products.
  • In the Facebook Dashboard, click on the 'Settings' section in the left hand menu.
  • Enter a display name, app icon and contact email address.
  • Click the 'Add Platform' button, and choose iOS. In the 'Bundle ID' section, add the widget ID from your config.xml file.
  • Click the 'Add Platform' button, and choose Android. In the 'Google Play Package Name' enter your widget ID.
  • You now need to generate an Android keystore hash. Do this with the following command: keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64 - replacing <RELEASE_KEY_ALIAS> with your keystore alias and pointing to your <RELEASE_KEY_PATH>.
  • Under the 'Dashboard' section, copy the App ID.
  • In your ionic project, install the facebook plugin with ionic cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication", changing the App ID and App Name as appropriate.
  • Go to Coreo, and find the correct project. Get the project ID and set it as the projectId option in your call to CoreoModule.forRoot({}) in your app's module file.
  • Back in Coreo, go to the 'OAuth Credentials' tab. Click 'Create Credential'. Choose the 'Facebook' provider, and enter the App ID and secret from the Facebook Dashboard here.

You should now be able to use the Facebook login component.

Google

  • In your Ionic project, make sure you have a widget ID setup in your config.xml file.
  • Follow the instructions in this section: https://github.com/EddyVerbruggen/cordova-plugin-googleplus#3-google-api-setup
  • Take the reverse client ID from the resulting .plist file.
  • In your ionic project, install the plugin with ionic cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=<REVERSED_CLIENT_ID>. The REVERSED_CLIENT_ID will start with com.googleusercontent.apps.
  • Go to Coreo, and find the correct project. Get the project ID and set it as one of the options in your call to CoreoModule.forRoot({}) in your app's module file.
  • Go to the Google Developer console at https://console.developers.google.com. Make sure you have selected the correct project.
  • Click on the Credentials section on the left hand menu.
  • Under 'OAuth 2.0 client IDs', click on the 'Web client'.
  • Under the 'Authorised redirect URIs' section, add the following addresses (make sure you click Save afterwards):
  • In a separate browser tab, go to Coreo. Go to the 'OAuth Credentials' tab. Click 'Create Credential'. Choose the 'Google' provider, and enter the App ID and secret from the other tab here.
  • Use the web client ID and set it as the googleWebClientId in your call to CoreoModule.forRoot({}) in your app's module file.

FAQs

Package last updated on 15 Jun 2018

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