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

Update README.MD with information regarding Cloud Support #217

Closed
3 tasks done
fuzzzerd opened this issue Aug 2, 2022 · 3 comments · Fixed by #222
Closed
3 tasks done

Update README.MD with information regarding Cloud Support #217

fuzzzerd opened this issue Aug 2, 2022 · 3 comments · Fixed by #222
Labels
enhancement New feature or request
Milestone

Comments

@fuzzzerd
Copy link
Owner

fuzzzerd commented Aug 2, 2022

  • Update packages table with Nuget/Myget info cards.
  • Update package description list.
  • Update Example Usage to include a sample for FileMaker Cloud.

Follow-up docs for #213.

@fuzzzerd fuzzzerd added the enhancement New feature or request label Aug 2, 2022
@fuzzzerd fuzzzerd added this to the v5 milestone Aug 2, 2022
@fuzzzerd
Copy link
Owner Author

fuzzzerd commented Aug 2, 2022

@heebinho could you provide a sample of how to use the new Auth library as a comment here? I'd like to include a new section in the readme file.

@fuzzzerd fuzzzerd linked a pull request Aug 2, 2022 that will close this issue
@heebinho
Copy link
Contributor

heebinho commented Aug 2, 2022

FileMaker Cloud

Setup

First of all you'll have to activate the FileMaker Data API in the FileMaker Cloud Admin Console.
(You can find the link to your Admin Console under: https://console.claris.com/app/hosts)

When you're already there, note the URL of your Host. Most likely it will look something like https://{NAME}.account.filemaker-cloud.com.

image

To access any given database via the Rest API, you'll have to grant special rights to a "Privilege Set" and assign the set to a user or group. Open the database in FileMaker Pro and choose Manage Security from the File menu. On top of the dialog you'll find a dropdown named "Authenticate via" - select the option Claris ID. Navigate to the advanced settings. In the register "Extended Privileges", you'll find an entry fmrest ("Access via FileMaker Data API"). Add this special right to a "Privilege Set". Assign the set to the user or group.

image

image

Instantiate the client

We can use the FileMakerRestClient, when the setup is done.
Just create a new ConnectionInfo object and set the required properties:

    var conn = new ConnectionInfo();
    conn.FmsUri = "https://{NAME}.account.filemaker-cloud.com";
    conn.Username = "user@domain.com";
    conn.Password = "********";
    conn.Database = "Reporting";

Then instantiate the FileMakerRestClient with a FileMakerCloudAuthTokenProvider as follows:

    var fm = new FileMakerRestClient(new HttpClient(), new FileMakerCloudAuthTokenProvider(conn));

From here you can use the client according to the given samples in the readme.
You can also check, whether the authentication was successful:

    await fm.RefreshTokenAsync();
    Assert.True(fm.IsAuthenticated);

Note

AWS Cognito is used as Identity provider. You can find more information here.
You'll find the following preconfigured properties in the ConnectionInfo object:

  • RegionEndpoint (Region)
  • CognitoUserPoolID (UserPool_ID)
  • CognitoClientID (Client_ID)

@fuzzzerd
Copy link
Owner Author

fuzzzerd commented Aug 2, 2022

Thank you @heebinho, this is fantastic!

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

Successfully merging a pull request may close this issue.

2 participants