Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to authenticate so I can query candidates in the system #49

Open
bnbon opened this issue Dec 30, 2019 · 0 comments
Open

Attempt to authenticate so I can query candidates in the system #49

bnbon opened this issue Dec 30, 2019 · 0 comments

Comments

@bnbon
Copy link

bnbon commented Dec 30, 2019

Hi,

I am using React (react-boilerplate) and this library with the intention to allow visitors to a website to query the candidates in the bullhorn system.

I am aware I will need to hide the variables in use by the system, but regardless I just want to do the above first in a rough and ready way initially.

This is the code I have, with obvious omissions, but the URL for login returns a 404 – yet it is taken exactly from the docs.

import React, { Component } from 'react';
import { Staffing, StaffingCredentialsAuthProvider } from '@bullhorn/taurus';

const provider = new StaffingCredentialsAuthProvider(
  'USERNAME',
  'PASSWORD',
);

const staffing = new Staffing({
  useCookies: false,
  client_id: 'CLIENT_ID',
  apiVersion: '*',
  redirect_url: 'http://0.0.0.0:3000',
  authorization_url: 'http://auth.bullhornstaffing.com/oauth/authorize',
  token_url: 'http://auth.bullhornstaffing.com/oauth/token',
  login_url: 'http://rest.bullhornstaffing.com/rest-services/login',
});

class SearchPage extends Component {
  doSearch = () => {
    console.log(`Login Attempt`);

    staffing.login(provider).then(() => {
      console.log('2');
      // never reached
    });

    console.log('1');
  };

  render() {
    this.doSearch();

    return (
      <>
          <h1>search</h1>
      </>
    );
  }
}

export default SearchPage;

Are these urls different now - or am I making a mess of this; the documentation is a little unclear, but I would have thought search candidates from the system would be quite straight forward?

Many Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant