Okta application just redirect to a url - okta

One of our requirements Is provision an app to an Okta user so he can click the app box and just redirect to an url with some query string parameters, no login required, is this possible using Okta?

You can add a Bookmark Application using the Apps API:
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
"name": "bookmark",
"label": "Custom Bookmark App",
"signOnMode": "BOOKMARK",
"settings": {
"app": {
"requestIntegration": false,
"url": "https://example.com/bookmark.htm?your=query&params=stuff"
}
}
}' "https://${org}.okta.com/api/v1/apps"
Then assign that app to a user:
curl -v -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{}' "https://${org}.okta.com/api/v1/apps/:appId/users/:userId"

To add on to kevlened's accepted answer, you can add a bookmark app through the Admin UI by going to Applications >> Applications >> Add Application >> search for "bookmark" from the application templates and you'll get the option to add a Bookmark App. This works in Version 2018.07 and perhaps earlier.

Related

Spring Boot and Spring Security Keyclock Integration - Error: connect ECONNREFUSED ::1:8180

I am doing Spring Cloud microservices development using link here - https://www.youtube.com/watch?v=LaZGedpfAyM&t=1279s and I was able to successfully make the GET request but for POST request I am getting the below error.
Source Code link - https://github.com/SaiUpadhyayula/springboot-microservices-project
I am not able to investigate as it seems as it seems issue at Keyclock?
CURL request -
curl --location --request POST 'http://127.0.0.1:8080/api/order' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJwYkNvVGtKOE0tZmZLaXJ0OXRVRjFNSlFxVUJlaXA3YlJFVzY3akpBMmEwIn0.eyJleHAiOjE2MTg3NDk4MzUsImlhdCI6MTYxODc0OTUzNSwiYXV0aF90aW1lIjoxNjE4NzQ5Mzc3LCJqdGkiOiJmZDZmYmEwZC1kMjg5LTRjMDEtYTc5MS02NTU1MGJiOTJmOWIiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgxODAvYXV0aC9yZWFsbXMvbWljcm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SESSION=9328910f-b82e-4fc9-9019-8ae9259aef8e' \
--data-raw '{
"orderLineItemsList" : [
{
"skuCode" : "iPhone 12",
"price": 1230,
"quantity" : 1
}
]
}'

How can I send a parse push to an installation id or device token

How can I use the Parse REST API to push to a specific deviceToken or installation Id? I make the request and it succeeds with a 200 response but I get no push.
curl -X POST \
-H "X-Parse-Application-Id: XYZ" \
-H "X-Parse-REST-API-Key: FOO" \
-H "Content-Type: application/json" \
-d '{
"where": {
"deviceToken": "someId"
},
"data": {
"alert": "Willie Hayes injured by own pop fly."
}
}' \
https://api.parse.com/1/push

Can a pointer field, to "user" class, be updated via rest api?

I have a class A that has a pointer (pointer field) to the special class User. Is it possible to automatically update the pointer field with the authenticated user, using the Rest API instead of having to call the API like the example bellow?
curl -X POST \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "X-Parse-Session-Token: ${SESSION_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"user":{ "__type": "Pointer", "className": "_User", "objectId": "${id}"}}' \
https://api.parse.com/1/classes/A
I would like to update the User field by just using the call:
curl -X POST \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "X-Parse-Session-Token: ${SESSION_TOKEN}" \
-H "Content-Type: application/json" \
https://api.parse.com/1/classes/A
And an A entry would be created.
A : {Pointer<_User> user_from_session, string objectId}
Any enlightenment is appreciated.
Cheers.
I've managed to accomplish what I wanted by adding an afterSave trigger. When creating A, with an authenticated request, I will read the current user from the session and set the field in the class. Bellow the example.
Parse.Cloud.afterSave("A", function (request, response) {
var record = request.object;
var user = Parse.User.current();
if (record.existed() == false) {
record.set("user", user);
record.save().
then(function (record) {
response.success();
}, function (error) {
response.error();
});
} else {
console.log("[DEBUG] Normal save (A).");
response.success();
}
});
Cheers.

Parse batch upload API, what does error code 107 mean?

Why can't I add objects using Parse batch bulk import API?
curl -X POST \
-H "X-Parse-Application-Id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "X-Parse-REST-API-Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"requests":[
{
"method":"POST",
"path":"1/classes/Store",
"body":{
"storeNumber":3466,
"storeLocation":{
"__type":"GeoPoint",
"latitude":-88.481369,
"longitude":44.263837
},
"storeAddress":"4733 W. GRANDE MARKET DR. GRAND CHUTE WI 54913 US"
}
},
...
{
"method":"POST",
"path":"1/classes/Store",
"body":{
"storeNumber":119,
"storeLocation":{
"__type":"GeoPoint",
"latitude":-122.171134,
"longitude":37.444756
},
"storeAddress":"165 STANFORD SHOPPING CTR PALO ALTO CA 94304-1409 US"
}
}
]
}' \
https://api.parse.com/1/batch
{"code":107,"error":"Method 'POST' to '1/classes/Store' not supported in batch operations."}
I have created a 'Store' object with matching column names/types but can't any any rows with the batch API.
From looking at the documentation I would guess it is because your path is invalid.
You need an extra "/" at the front, so /1/classes/Store instead of 1/classes/Store.

Input::all() is not working - laravel 4

I'm new to Laravel, tried posting data using the following cURL command but when I try to read data, it wouldn't do it.
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":100}' api.xyz.com/test
There's a solution here* using file_get_contents but I'm sure there must be a better way:
Laravel - POST data is null when using external request
I ran the following curl command
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name":"John", "surname":"Doe"}' http://localhost/laravel/public/test
and returned a json_encode(Input::all()) in my HomeController#test and got the following output
{"name":"John","surname":"Doe"}
HomeController.php
public function test()
{
return json_encode(Input::all());
}
routes.php
Route::post('/test', 'HomeController#test');

Resources